fix(plex): the recs rail's anchor and a held recommendation are named in the reader's language (E30 S1b)

Found in the S1b UAT: 'Mert megnézted: Batman Forever' kept the English title, and
the info page's TMDB recommendations kept TMDB's English titles even for titles we
hold. A held recommendation is now named as the library names it, in the reader's
language; one we lack keeps TMDB's title.
This commit is contained in:
2026-09-29 02:25:36 +02:00
parent 632e39d458
commit f6298d29af
5 changed files with 51 additions and 11 deletions
+4 -2
View File
@@ -255,13 +255,13 @@ def test_serve_block_none_until_enriched_and_resolves_recs(db):
db.add_all([sequel, fresh])
db.commit()
assert tmdb.serve_block(db, fresh) is None # not enriched yet
assert tmdb.serve_block(db, fresh, lang="en") is None # not enriched yet
tmdb.apply_tmdb_detail(fresh, tmdb.parse_tmdb(MOVIE_PAYLOAD, "movie"))
fresh.tmdb_enriched_at = datetime.now(timezone.utc)
db.commit()
block = tmdb.serve_block(db, fresh)
block = tmdb.serve_block(db, fresh, lang="en")
assert block is not None
assert block["budget"] == 6000000
assert block["keywords"] == ["mafia", "crime family"]
@@ -409,6 +409,7 @@ def test_resolve_recs_matches_by_media_type_not_bare_id(db):
{"tmdb_id": 500, "title": "Movie 500", "media_type": "movie"},
{"tmdb_id": 900, "title": "Show 900", "media_type": "tv"},
],
lang="en",
)
}
assert miss[500]["in_library"] is False and miss[500]["rating_key"] is None
@@ -423,6 +424,7 @@ def test_resolve_recs_matches_by_media_type_not_bare_id(db):
{"tmdb_id": 900, "media_type": "movie"},
{"tmdb_id": 500, "media_type": "tv"},
],
lang="en",
)
}
assert hit[900]["in_library"] is True and hit[900]["rating_key"] == "m900"