import { FastifyInstance } from 'fastify';
import * as controller from './local.controller';

async function localRoutes(fastify: FastifyInstance) {
    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);
    fastify.get('/library/:id/units', controller.getUnits);
    fastify.get('/library/:unitId/manifest', controller.getManifest);
    fastify.get('/library/:unitId/resource/:resId', controller.getPage);
}

export default localRoutes;