Fix /media route by mounting cache router directly

Avoids Depends() resolution issues with manual function calls.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
giles
2026-01-11 13:21:26 +00:00
parent 3f77c24699
commit b47417704e

View File

@@ -87,14 +87,8 @@ def create_app() -> FastAPI:
# Cache router - handles /cache and /media
app.include_router(cache.router, prefix="/cache", tags=["cache"])
# Also mount media list at /media for convenience
from fastapi import APIRouter as MediaRouter
media_router = MediaRouter()
@media_router.get("")
async def media_list_redirect(request: Request, offset: int = 0, limit: int = 24):
from .routers.cache import list_media
return await list_media(request, offset, limit)
app.include_router(media_router, prefix="/media", tags=["media"])
# Also mount cache router at /media for convenience
app.include_router(cache.router, prefix="/media", tags=["media"])
return app