Add GET /collections browse endpoint; fix embedded collection poster_path
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

Completes browse/discover across all five entity types: movies, series,
people, companies, and now collections. No filter (no categorical field
like company_type exists for a collection) -- just page/page_size,
always alphabetical by name.

While adding poster_path to CollectionBriefOut for the browse listing,
found the same class of bug fixed earlier for company logo_path:
movie_service's embedded `collection` field never looked up its poster
artwork either, so it stayed null even after ingest_collection populated
one. Fixed alongside since it's the same schema field this feature was
already touching.

Also removed PageMeta from schemas/common.py -- scaffolding from early
spec work that was never actually wired into any endpoint; all five
browse endpoints shipped this session use a flat page/page_size/
total_results/total_pages shape instead.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
NixReaper
2026-09-05 20:08:26 -05:00
co-authored by Claude Sonnet 5
parent 4cf3556433
commit f1ac072794
9 changed files with 184 additions and 21 deletions
+12 -7
View File
@@ -54,6 +54,17 @@ async def get_movie_detail(session: AsyncSession, movie_aurora_id: str) -> Movie
cast, crew = split_credits(credits_)
collection_out: CollectionBriefOut | None = None
if movie.collection is not None:
collection_posters = await polymorphic.get_artwork(
session, "collection", movie.collection.id, ArtworkType.POSTER
)
collection_out = CollectionBriefOut(
id=aurora_id("collection", str(movie.collection.id)),
name=movie.collection.name,
poster_path=primary_artwork_path(collection_posters, ArtworkType.POSTER),
)
company_out: list[CompanyBriefOut] = []
for company, _role in companies:
logos = await polymorphic.get_artwork(session, "company", company.id, ArtworkType.LOGO)
@@ -87,13 +98,7 @@ async def get_movie_detail(session: AsyncSession, movie_aurora_id: str) -> Movie
cast=cast,
crew=crew,
companies=company_out,
collection=(
CollectionBriefOut(
id=aurora_id("collection", str(movie.collection.id)), name=movie.collection.name
)
if movie.collection
else None
),
collection=collection_out,
images=to_images_out(artwork),
videos=[to_video_out(v) for v in videos],
external_ids=external_ids,