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

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:
NixReaper
2026-09-06 04:07:18 -05:00
co-authored by Claude Sonnet 5
parent 340cadd99d
commit e1a36ce227
15 changed files with 510 additions and 5 deletions
+6
View File
@@ -14,6 +14,7 @@ from app.schemas.common import (
GenreOut,
ImagesOut,
KeywordOut,
ReleaseDateOut,
VideoOut,
)
@@ -49,6 +50,10 @@ class MovieDetailOut(BaseModel):
vote_average: float | None = None
vote_count: int | None = None
adult: bool = False
# The US MPA rating (e.g. "PG-13"), the badge TMDb shows next to a
# title by default -- convenience pick out of `release_dates` below for
# a client that just wants a single rating without picking a country.
certification: str | None = None
genres: list[GenreOut] = []
keywords: list[KeywordOut] = []
@@ -58,6 +63,7 @@ class MovieDetailOut(BaseModel):
collection: CollectionBriefOut | None = None
images: ImagesOut = ImagesOut()
videos: list[VideoOut] = []
release_dates: list[ReleaseDateOut] = []
external_ids: dict[str, str] = {}
created_at: datetime