Repository navigation
Description
Summary
Per-item track "overrides" survive unevenly across playback sessions. Audio round-trips exactly; subtitles round-trip only as a fuzzy signature; version picks for movies don't round-trip at all. Three server-side gaps, in descending impact:
1. Surface effective_subtitle_track_index per file version
Audio prefs come back as an exact per-file index (FileVersion.effective_audio_track_index, set from GetAudioPreference in internal/catalog/detail.go:2478-2533 → :2775). Subtitle prefs are stored with an exact subtitle_track_index (internal/userdb/subtitle_prefs.go), but effectiveSubtitleDefaults (internal/catalog/detail.go:2325-2382) only copies language / mode / show-forced / track-signature into the detail response — the stored index is never echoed.
Clients therefore have to re-derive the pick by fuzzy-matching the signature against the track list (language + codec + label scoring). That works most of the time but is heuristic, and every client (web, Apple, Android) has to reimplement the same matcher to show/restore the pick.
Proposed: compute a per-version effective_subtitle_track_index next to effective_audio_track_index — validate the stored index against the version's subtitle streams (signature-match fallback for episodes where stream order differs), mirroring the audio resolver. -1 (or an explicit mode field) should distinguish a stored "Off".
2. /playback/start never applies stored audio prefs for movies
The fallback that folds the saved audio pref into playback start keys on resolveSeriesID (internal/api/handlers/playback.go:1353-1354), and resolveSeriesID returns "" for any file without an EpisodeID (playback.go:869-878) — so a movie's stored audio preference (written keyed by the movie's content id, which the detail resolver reads back fine at detail.go:2208) is silently ignored at start. Today this is masked because clients pass the explicit AudioTrackIndex they read from the detail response, but any start path that omits it (deep links, remote control, autoplay) plays the container default.
Proposed: when the file has no episode, fall back to looking up the pref by the item's content id — same key the detail resolver already uses.
3. No version/file preference for movies
persistSeriesPlaybackPreference early-returns for movies (playback.go:1247-1250) and the movie watch-detail branch (detail.go:2200-2219) never calls effectiveVersionDefaults, so a movie version pick (e.g. choosing the SDR file over the DV one) is forgotten the moment the user leaves the item. Series get resolution/HDR/codec stickiness; movies get nothing.
Proposed: store and read version prefs keyed by content id for movies, same shape as the series pref.
Context
Apple client-side counterpart (selector state not seeded from the server pref) is fixed in silo-apple (fix(detail): restore remembered subtitle override in track selectors). With item 1 above, clients could drop their local signature matchers and use the exact index.
Activity
zZebrahz commentedon Jul 3, 2026
Will handle later, just adding a note here