Add now-playing and upcoming movie endpoints
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

Buildable now that release_dates exists: GET /movies/now-playing and
/movies/upcoming filter on release_type="theatrical" per region, windowed
around today. A movie can carry more than one theatrical-type row in the
same region (limited release then wide release both map to "theatrical"
per normalizer._RELEASE_TYPE_MAP) -- collapsed to one row per movie via a
grouped subquery rather than joining ReleaseDate directly, which would
duplicate the movie in the page and inflate the total count.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
NixReaper
2026-09-06 04:45:09 -05:00
co-authored by Claude Sonnet 5
parent 567b4ef068
commit 74ebad379a
5 changed files with 301 additions and 1 deletions
+20
View File
@@ -54,6 +54,26 @@ async def list_movies(
raise HTTPException(status.HTTP_422_UNPROCESSABLE_CONTENT, str(exc)) from exc
@router.get("/now-playing", response_model=MovieListOut)
async def now_playing_movies(
region: str = Query("US", min_length=2, max_length=2, description="ISO 3166-1 alpha-2 country"),
page: int = Query(1, ge=1),
page_size: int = Query(20, ge=1, le=50),
session: AsyncSession = Depends(get_db),
) -> MovieListOut:
return await movie_service.list_now_playing(session, region=region, page=page, page_size=page_size)
@router.get("/upcoming", response_model=MovieListOut)
async def upcoming_movies(
region: str = Query("US", min_length=2, max_length=2, description="ISO 3166-1 alpha-2 country"),
page: int = Query(1, ge=1),
page_size: int = Query(20, ge=1, le=50),
session: AsyncSession = Depends(get_db),
) -> MovieListOut:
return await movie_service.list_upcoming(session, region=region, page=page, page_size=page_size)
@router.get("/{aurora_id}", response_model=MovieDetailOut)
async def get_movie(
aurora_id: str,