Expose certifications and per-country release dates
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
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
TMDb's release_dates/content_ratings blocks were already fetched via append_to_response but discarded at normalization -- every downstream layer (ingestion write, repository read, schema, service) was unbuilt. Adds the full pipeline: NormalizedReleaseDate + get_or_create_certification, a shared polymorphic sync/read (movie and series both use it), and MovieDetailOut/SeriesDetailOut certification + release_dates fields. Series content_ratings has no date of its own, so each rating is anchored to the show's first_air_date with release_type="tv". Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
340cadd99d
commit
e1a36ce227
@@ -25,7 +25,14 @@ from app.schemas.tv import (
|
||||
SeriesSummaryOut,
|
||||
SeriesVideosOut,
|
||||
)
|
||||
from app.services.common import primary_artwork_path, split_credits, to_images_out, to_video_out
|
||||
from app.services.common import (
|
||||
pick_certification,
|
||||
primary_artwork_path,
|
||||
split_credits,
|
||||
to_images_out,
|
||||
to_release_date_out,
|
||||
to_video_out,
|
||||
)
|
||||
|
||||
|
||||
class SeriesNotFoundError(Exception):
|
||||
@@ -99,6 +106,7 @@ async def get_series_detail(session: AsyncSession, series_aurora_id: str) -> Ser
|
||||
credits_ = await polymorphic.get_credits(session, "series", series_id)
|
||||
artwork = await polymorphic.get_artwork(session, "series", series_id)
|
||||
videos = await polymorphic.get_videos(session, "series", series_id)
|
||||
release_dates = await polymorphic.get_release_dates(session, "series", series_id)
|
||||
external_ids = await polymorphic.get_external_ids(session, "series", series_id)
|
||||
|
||||
cast, crew, creators = _split_series_credits(credits_)
|
||||
@@ -122,6 +130,7 @@ async def get_series_detail(session: AsyncSession, series_aurora_id: str) -> Ser
|
||||
popularity=series.popularity,
|
||||
vote_average=series.vote_average,
|
||||
vote_count=series.vote_count,
|
||||
certification=pick_certification(release_dates),
|
||||
genres=[GenreOut(id=aurora_id("genre", str(g.id)), name=g.name) for g in genres],
|
||||
keywords=[KeywordOut(id=aurora_id("keyword", str(k.id)), name=k.name) for k in keywords],
|
||||
creators=creators,
|
||||
@@ -132,6 +141,7 @@ async def get_series_detail(session: AsyncSession, series_aurora_id: str) -> Ser
|
||||
seasons=season_briefs,
|
||||
images=to_images_out(artwork),
|
||||
videos=[to_video_out(v) for v in videos],
|
||||
release_dates=[to_release_date_out(rd) for rd in release_dates],
|
||||
external_ids=external_ids,
|
||||
created_at=series.created_at,
|
||||
updated_at=series.updated_at,
|
||||
|
||||
Reference in New Issue
Block a user