refactor(recordings): eliminate Router/mount, expose direct handler methods to avoid shelf_router path collision

This commit is contained in:
Michael committed 2026-03-08 22:10:59 +01:00
1 parent d91be43f27
commit 7e0837374e
2 files changed
+50 -79

No files matched your search

+7 -9
View File
@@ -116,15 +116,13 @@ void main(List<String> args) async {
.addMiddleware(authMiddleware(db))
.addHandler(settingsHandler.router.call),
)
// TV Recordings - Route des logs AVANT le mount general (évite collision shelf_router avec /<id>)
..get('/api/recordings/logs/<id>', recordingsApi.getLogHandler)
// TV Recordings endpoints (GET /, POST /, DELETE /<id>)
..mount(
'/api/recordings',
const Pipeline()
//.addMiddleware(authMiddleware(db)) // TODO: Activer quand UI aura l'Auth header
.addHandler(recordingsApi.router.call),
);
// TV Recordings - Chaque route déclarée EXPLICITEMENT pour éviter les conflits shelf_router
// NE PAS utiliser mount() ici car mount('/api/recordings', ...) intercepte TOUT
// ce qui commence par /api/recordings (y compris /api/recordings/logs/<id>)
..get('/api/recordings', recordingsApi.handleGetAll)
..post('/api/recordings', recordingsApi.handlePost)
..delete('/api/recordings/<id>', recordingsApi.handleDelete)
..get('/api/recordings/logs/<id>', recordingsApi.getLogHandler);
// NOTE: /api/xtream is handled by proxyHandler in the Cascade below
// Do NOT mount here as it would intercept and block the actual proxy