Add GET /movies/{id}/recommendations
CI / lint (push) Canceled after 0s
CI / typecheck (push) Canceled after 0s
CI / unit-tests (push) Canceled after 0s
CI / integration-tests (push) Canceled after 0s
CI / container-build (push) Canceled after 0s
CI / dependency-audit (push) Canceled after 0s

Ingestion already stored movie_recommendations edges from TMDb's
recommendations list (linking only to movies already ingested into
Aurora, per the never-fabricate-a-stub rule), but nothing exposed them.
Adds the repository lookup, service assembly, and route to read them
back in ranked order.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
NixReaper
2026-09-05 08:16:18 -05:00
co-authored by Claude Sonnet 5
parent 73488a0d80
commit 4af4ba40ef
6 changed files with 106 additions and 2 deletions
+17 -1
View File
@@ -10,7 +10,13 @@ from app.api.deps import cached_response, not_found
from app.core.database import get_db
from app.core.redis import get_redis
from app.core.security import enforce_rate_limit
from app.schemas.movie import MovieCreditsOut, MovieDetailOut, MovieImagesOut, MovieVideosOut
from app.schemas.movie import (
MovieCreditsOut,
MovieDetailOut,
MovieImagesOut,
MovieRecommendationsOut,
MovieVideosOut,
)
from app.services import movie_service
from app.services.cache import build_key
@@ -62,3 +68,13 @@ async def get_movie_videos(
return await movie_service.get_movie_videos(session, aurora_id)
except movie_service.MovieNotFoundError as exc:
raise not_found("movie", aurora_id) from exc
@router.get("/{aurora_id}/recommendations", response_model=MovieRecommendationsOut)
async def get_movie_recommendations(
aurora_id: str, session: AsyncSession = Depends(get_db)
) -> MovieRecommendationsOut:
try:
return await movie_service.get_movie_recommendations(session, aurora_id)
except movie_service.MovieNotFoundError as exc:
raise not_found("movie", aurora_id) from exc