Enrich existing movies (from paradisehill/dooplay, which mostly lack cast) with metadata from TPDB's /movies API: cast, categories (tags), studio, director + a canonical TPDB UUID for dedup. Chosen over IAFD after a source-comparison research pass — IAFD has strong cast/studio but ZERO categories, while TPDB /movies has ~11 tags/movie, cast, studio, director, a canonical UUID (+ sparse phash), is already an integrated API (no scraping/anti-bot), and covers ~75-85% of our western-DVD-feature catalog. Enrichment only ever augments EXISTING movies and never creates new ones (TPDB has no playback, so a standalone TPDB movie would be unplayable). Writes to movie_performers / movie_tags / movie.studio_id, which the movies API + mobile detail already render, so no schema/API/UI change is needed. - connectors/tpdb.py: search_movies() + fetch_movie() + _parse_movie() reusing the existing _parse_studio/_parse_performer/_parse_tag. - enrich/tpdb_movies.py: match our movie to a TPDB /movies result by token_sort_ratio on normalized titles (sort, not set, to reject the short-title-subset trap "Fantasies" -> "Tara's Fetish Fantasies") with a +/-2yr guard; then attach cast/tags/studio/director. Incoming performers deduped by external_id to avoid the performer_external_refs PK clash. - resolve/movie_merge.py: merge_movies() mirror of scene_merge; two of our movies mapping to the same TPDB UUID are the same film -> merge. - scheduler: _job_tpdb_movie_enrich every 6h, batch 200, prioritizing playable movies missing cast/studio. Verified on a 150-movie batch: 119 enriched, 4 deduped, 26 no-match, 0 errors; matched titles/studios spot-checked correct (Big Butts Drive Me Nuts 4 -> 33 tags, Seinfeld #2 -> 10 cast/17 tags, German BB Video titles -> categories+studio). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 line
88 B
Python
1 line
88 B
Python
"""Post-ingest enrichment of canonical entities from authoritative metadata sources."""
|