The grid served Hungarian titles, but every other card surface (Discover rails, the show page's episodes, search, collections, the person page, playlists, Home's resume rail, hero and comfort shelf) served English. The card serializers now take a required keyword-only lang (a forgotten call site fails instead of going English), and each of those reads takes ?lang=hu, with the language in its query key. A Hungarian search finds an episode by its Hungarian title too. An episode on a poster rail showed its 16:9 still cropped into a poster, titled only with the episode name; it now shows the show's poster and name, with S·E · title under it (option A). Plex's generic season names (Season 1, Specials) are rebuilt from the number in the reader's language; a season with a name of its own keeps it. Home's comfort-shelf move wrote its optimistic order to the key without the language, which nothing read any more; it writes the query's own key.
19 lines
560 B
Python
19 lines
560 B
Python
"""Shared helpers, serializers and constants for the plex route package."""
|
|
|
|
from sqlalchemy.orm import Session
|
|
|
|
from app import logs
|
|
from app.models import PlexItem
|
|
from app.plex.cards import norm_lang as _norm_lang # noqa: F401 — the package's historic name
|
|
from app.plex.lookups import by_rating_key
|
|
from app.routes._common import not_found
|
|
|
|
log = logs.get_logger(__name__)
|
|
|
|
|
|
def item_or_404(db: Session, rating_key: str) -> PlexItem:
|
|
it = by_rating_key(db, PlexItem, rating_key)
|
|
if it is None:
|
|
raise not_found("plex_item")
|
|
return it
|