Add collection/franchise ingestion
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

Collections were bare stubs (name only) lazily created the moment a
movie's belongs_to_collection reference was seen. Adds a real
ingest_collection pipeline: TMDb's /collection/{id} for overview and
poster/backdrop artwork, plus ordered CollectionMovie membership --
linking only movies already ingested into Aurora, the same
never-fabricate-a-stub rule movie recommendations already follow.

get_or_create_collection now refreshes name/overview on an existing
stub instead of only creating, guarded so a bare movie-stub call
(overview=None) never clobbers real data a full ingestion already
filled in.

New POST /api/v1/admin/ingest/collection endpoint and
ingest_collection_task; GET /api/v1/collections/{id} needed no changes
since its read path (collection_service.py) already assembled the full
detail shape.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
NixReaper
2026-09-05 08:37:27 -05:00
co-authored by Claude Sonnet 5
parent 4af4ba40ef
commit 892f78016c
15 changed files with 460 additions and 1 deletions
+11
View File
@@ -33,6 +33,7 @@ from app.repositories.provider_repository import (
)
from app.repositories.tv_repository import get_seasons_for_series, get_series_companies
from app.services.cache import build_key, cache_delete
from app.services.ingestion.collection_ingestion import ingest_collection
from app.services.ingestion.movie_ingestion import ingest_movie
from app.services.ingestion.person_ingestion import ingest_person
from app.services.ingestion.series_ingestion import ingest_season, ingest_series
@@ -164,6 +165,16 @@ async def run_series_ingestion(job_id: uuid.UUID, external_id: str) -> uuid.UUID
)
async def run_collection_ingestion(job_id: uuid.UUID, external_id: str) -> uuid.UUID:
return await _run_ingestion(
job_id,
"collection_ingestion",
lambda session, provider: ingest_collection(
session, provider, external_id, ingestion_job_id=job_id
),
)
async def run_season_ingestion(
job_id: uuid.UUID, series_external_id: str, season_number: int
) -> uuid.UUID: