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
@@ -112,6 +112,19 @@ class CollectionBriefOut(BaseModel):
|
||||
poster_path: str | None = None
|
||||
|
||||
|
||||
class CertificationOut(BaseModel):
|
||||
system: str
|
||||
rating: str
|
||||
|
||||
|
||||
class ReleaseDateOut(BaseModel):
|
||||
country_code: str
|
||||
release_date: date
|
||||
release_type: str | None = None
|
||||
certification: CertificationOut | None = None
|
||||
note: str | None = None
|
||||
|
||||
|
||||
class ErrorDetail(BaseModel):
|
||||
code: str
|
||||
message: str
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -13,6 +13,7 @@ from app.schemas.common import (
|
||||
GenreOut,
|
||||
ImagesOut,
|
||||
KeywordOut,
|
||||
ReleaseDateOut,
|
||||
VideoOut,
|
||||
)
|
||||
|
||||
@@ -54,6 +55,9 @@ class SeriesDetailOut(BaseModel):
|
||||
popularity: float | None = None
|
||||
vote_average: float | None = None
|
||||
vote_count: int | None = None
|
||||
# The US TV rating (e.g. "TV-MA") -- convenience pick out of
|
||||
# `release_dates` below, same as MovieDetailOut.certification.
|
||||
certification: str | None = None
|
||||
|
||||
genres: list[GenreOut] = []
|
||||
keywords: list[KeywordOut] = []
|
||||
@@ -65,6 +69,7 @@ class SeriesDetailOut(BaseModel):
|
||||
seasons: list[SeasonBriefOut] = []
|
||||
images: ImagesOut = ImagesOut()
|
||||
videos: list[VideoOut] = []
|
||||
release_dates: list[ReleaseDateOut] = []
|
||||
external_ids: dict[str, str] = {}
|
||||
|
||||
created_at: datetime
|
||||
|
||||
Reference in New Issue
Block a user