Files
Aurora-Core/app/schemas/person.py
T
NixReaperandClaude Sonnet 5 ec6b5bdd7d
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
Surface series/episode credits in person filmography
/people/{id}/credits only ever looked at entity_type == "movie",
silently dropping the series-level cast/crew and episode-level
guest-star Credit rows that series_ingestion.py has been writing all
along -- a person ingested via a TV show would show an empty or
movie-only filmography no matter how much TV work was actually in the
database.

Regular series credits map straight to a filmography row, same shape
as movies. Guest-star episode credits are aggregated to one row per
(series, department/job/character) with an episode_count, rather than
one row per episode -- a prolific guest actor would otherwise flood
the list with dozens of near-identical entries. Added
tv_repository.get_series_by_ids/get_episodes_by_ids (bulk, mirroring
the existing movie_repository pattern) to support it.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-09-04 20:00:15 -05:00

61 lines
1.6 KiB
Python

"""Person response schemas."""
from __future__ import annotations
from datetime import date, datetime
from pydantic import BaseModel
from app.schemas.common import ArtworkOut
class PersonSummaryOut(BaseModel):
id: str
type: str = "person"
name: str
known_for_department: str | None = None
profile_path: str | None = None
popularity: float | None = None
class FilmographyCreditOut(BaseModel):
id: str
media_id: str
media_type: str
title: str
department: str
job: str | None = None
character: str | None = None
release_date: date | None = None
poster_path: str | None = None
# Set only for series filmography built from guest-star episode credits:
# how many distinct episodes this character/credit appeared in, since
# those are aggregated to one row per series rather than one per
# episode. None for movie credits and regular (non-guest) series roles.
episode_count: int | None = None
class PersonDetailOut(BaseModel):
id: str
type: str = "person"
name: str
aliases: list[str] = []
biography: str | None = None
birthday: date | None = None
deathday: date | None = None
birthplace: str | None = None
gender: str | None = None
known_for_department: str | None = None
popularity: float | None = None
profile_images: list[ArtworkOut] = []
external_ids: dict[str, str] = {}
created_at: datetime
updated_at: datetime
class PersonCreditsOut(BaseModel):
id: str
cast: list[FilmographyCreditOut] = []
crew: list[FilmographyCreditOut] = []