feat(plex): episodes, taglines and genres in Hungarian from the HU overlay (E30 S1a)
The HU TV section lists every episode with its Hungarian title and summary, but the overlay read only movies and shows, so every episode stayed English. It now overlays the episodes too, and the HU tagline (new tagline_hu column, served on ?lang=hu). Plex's HU agent returns a mixed genre vocabulary (Action beside Dráma), and a title with no HU twin kept its English list, so the HU genre list showed Drama and Dráma. plex/genres.py maps every genre word to one Hungarian word; the overlay writes it into genres_hu for every row, and a HU genre filter is read through the same map, so a saved filter still holding Action keeps matching.
This commit is contained in:
@@ -30,7 +30,9 @@ def _seed(db):
|
||||
summary="English summary.",
|
||||
summary_hu="Magyar összefoglaló.",
|
||||
genres=["Drama"],
|
||||
genres_hu=["Dráma"],
|
||||
genres_hu=["Dráma", "Akció"],
|
||||
tagline="English tagline.",
|
||||
tagline_hu="Magyar mottó.",
|
||||
rating=6.5,
|
||||
imdb_rating=None,
|
||||
year=2001,
|
||||
@@ -102,12 +104,25 @@ def test_genre_filter_matches_active_language_vocabulary(db, monkeypatch, overri
|
||||
assert miss.json()["items"] == []
|
||||
|
||||
|
||||
def test_a_genre_filter_saved_in_english_still_matches_in_hungarian(db, monkeypatch, override_dep):
|
||||
"""E30: the HU column holds one Hungarian word per genre. A filter saved while the HU list still
|
||||
offered "Action" is read through the same map, so it finds the "Akció" title instead of nothing."""
|
||||
user = _seed(db)
|
||||
resp = _get(
|
||||
db, user, monkeypatch, override_dep, "/api/plex/library?scope=movie&lang=hu&genres=Action"
|
||||
)
|
||||
assert _titles(resp) == {"Magyar Cím"}
|
||||
|
||||
|
||||
def test_item_detail_language_and_rating_split(db, monkeypatch, override_dep):
|
||||
user = _seed(db)
|
||||
resp = _get(db, user, monkeypatch, override_dep, "/api/plex/item/m1?lang=hu")
|
||||
body = resp.json()
|
||||
assert body["title"] == "Magyar Cím"
|
||||
assert body["summary"] == "Magyar összefoglaló."
|
||||
assert body["tagline"] == "Magyar mottó." # E30: the HU overlay's tagline
|
||||
en = _get(db, user, monkeypatch, override_dep, "/api/plex/item/m1").json()
|
||||
assert en["tagline"] == "English tagline."
|
||||
# imdb_rating is IMDb-only (None here); the audience score is served separately as `rating`.
|
||||
assert body["imdb_rating"] is None
|
||||
assert body["rating"] == 6.5
|
||||
|
||||
Reference in New Issue
Block a user