implemented api for local library & global config

This commit is contained in:
2025-12-26 22:12:36 +01:00
parent dbce12b708
commit 6075dcf149
8 changed files with 394 additions and 3 deletions

View File

@@ -0,0 +1,14 @@
import { FastifyInstance } from 'fastify';
import * as controller from './local.controller';
async function localRoutes(fastify: FastifyInstance) {
fastify.get('/library/config', controller.getConfig);
fastify.post('/library/config', controller.setConfig);
fastify.post('/library/scan', controller.scanLibrary);
fastify.get('/library/:type', controller.listEntries);
fastify.get('/library/:type/:id', controller.getEntry);
fastify.get('/library/stream/:type/:id/:unit', controller.streamUnit);
fastify.post('/library/:type/:id/match', controller.matchEntry);
}
export default localRoutes;