Surface series/episode credits in person filmography
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

/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]>
This commit is contained in:
NixReaper
2026-09-04 20:00:15 -05:00
co-authored by Claude Sonnet 5
parent e6841badf8
commit ec6b5bdd7d
5 changed files with 228 additions and 28 deletions
+18
View File
@@ -19,6 +19,24 @@ async def get_series_by_id(session: AsyncSession, series_id: uuid.UUID) -> Serie
return result.scalar_one_or_none()
async def get_series_by_ids(session: AsyncSession, series_ids: list[uuid.UUID]) -> list[Series]:
if not series_ids:
return []
stmt = select(Series).where(Series.id.in_(series_ids))
result = await session.execute(stmt)
by_id = {s.id: s for s in result.scalars().all()}
return [by_id[i] for i in series_ids if i in by_id]
async def get_episodes_by_ids(session: AsyncSession, episode_ids: list[uuid.UUID]) -> list[Episode]:
if not episode_ids:
return []
stmt = select(Episode).where(Episode.id.in_(episode_ids))
result = await session.execute(stmt)
by_id = {e.id: e for e in result.scalars().all()}
return [by_id[i] for i in episode_ids if i in by_id]
async def get_season_by_number(
session: AsyncSession, series_id: uuid.UUID, season_number: int
) -> Season | None: