wip settings section
This commit is contained in:
@@ -65,27 +65,6 @@ async function resolveEntryMetadata(entry: any, type: string) {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
export async function getConfig(_request: FastifyRequest, reply: FastifyReply) {
|
||||
try {
|
||||
return loadConfig();
|
||||
} catch {
|
||||
return reply.status(500).send({ error: 'FAILED_TO_LOAD_CONFIG' });
|
||||
}
|
||||
}
|
||||
|
||||
export async function setConfig(request: FastifyRequest<{ Body: SetConfigBody }>, reply: FastifyReply) {
|
||||
try {
|
||||
const { body } = request;
|
||||
if (!body || typeof body !== 'object') {
|
||||
return reply.status(400).send({ error: 'INVALID_BODY' });
|
||||
}
|
||||
return saveConfig(body);
|
||||
} catch {
|
||||
return reply.status(500).send({ error: 'FAILED_TO_SAVE_CONFIG' });
|
||||
}
|
||||
}
|
||||
|
||||
export async function scanLibrary(request: FastifyRequest<{ Querystring: ScanQuery }>, reply: FastifyReply) {
|
||||
try {
|
||||
const mode = request.query.mode || 'incremental';
|
||||
|
||||
Reference in New Issue
Block a user