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
+2 -2
View File
@@ -211,7 +211,7 @@ def show_detail(
"episode_count": show_roll["episode_count"],
"collection_keys": sh.collection_keys or [],
# TMDB enrichment (E5 S2), served from the row.
"tmdb": plex_tmdb.serve_block(db, sh),
"tmdb": plex_tmdb.serve_block(db, sh, lang=lang),
},
"seasons": [_season_block(se, by_season.get(se.id, [])) for se in seasons],
"related": related,
@@ -517,5 +517,5 @@ def item_detail(
"next_id": next_id,
"collections": _collection_strips(db, it, user.id, lang),
# TMDB enrichment (E5 S2), served from the row — movies only (episodes aren't enriched).
"tmdb": plex_tmdb.serve_block(db, it) if it.kind == "movie" else None,
"tmdb": plex_tmdb.serve_block(db, it, lang=lang) if it.kind == "movie" else None,
}
+5 -2
View File
@@ -313,7 +313,7 @@ def _because_you_watched(
)
if anchor is None:
return None
resolved = resolve_recs(db, anchor.recommendations)
resolved = resolve_recs(db, anchor.recommendations, lang=lang)
# Preserve TMDB's recommendation order, keep only in-library hits, and drop the anchor itself.
rks = [
r["rating_key"]
@@ -362,7 +362,10 @@ def _because_you_watched(
items.append(scards[rk])
if not items:
return None
return {"anchor": {"id": anchor.rating_key, "title": anchor.title}, "items": items}
return {
"anchor": {"id": anchor.rating_key, "title": display_title(anchor, lang)},
"items": items,
}
@router.get("/discover")