Repository navigation
Conversation
Adds a "Always Show Subtitles" setting that turns subtitles on when neither the server nor a carried preference selects one, and a preferred subtitle language that the fallback and the search sheet share. Why not Plex's own per-user autoSelectSubtitle: it is a server-side account setting, so it cannot differ between two devices on the same account. A viewer who wants subtitles on the living-room TV and off on their phone has no way to express that today. The fallback runs where the ladder would otherwise return off - Plex's "rows exist, none selected" case and the final priority - and prefers full dialogue over a forced-only row, since signs-and-songs is not what "always show subtitles" means. It is a fallback, never a choice: the pick is reported through `isForcedFallback` so it is not carried across an item boundary, where a carried selection would match at navigation priority and be written back to the server as the viewer's explicit choice. Each item derives its own. `resolveSubtitleSearchLanguageCode` moves out of the search sheet into `subtitle_language.dart` so both callers read the same preference, and `subtitleLanguageMatches` moves to `language_codes.dart` - selection and the fallback must agree, and neither may prefix-compare (`est` is not `es`). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PQ9KU5JXvzTB7tkYyeDEut
The second half of edde746#2346, stacked on the always-on setting. Opt-in, Plex only: when an item carries no subtitle in the preferred language, search the server's online providers once and apply what comes back. Deliberately silent. This runs without anyone pressing anything, often on a TV across the room, so a failure leaves playback exactly as it was and says so only in the log. The manual search sheet remains the way to get feedback about what a provider does or does not have. A spinner shows while the search, the server-side download and the poll run, because a viewer who asked for subtitles is otherwise watching an unsubtitled picture with no idea anything is coming. Success needs no toast - the subtitles are the confirmation, and they arrive at the same moment. Ranking does not trust provider score alone: a confidently-scored result for an entirely different film sharing the title ("Target", 1985) beat the right one. Score now only breaks ties between results that already agree on `perfectMatch` (which comes from the file, not its name), then the language actually asked for, then full dialogue over forced or hearing-impaired. The viewer may turn subtitles off while the server is still fetching. Applying then would switch them back on and, because the apply path writes the stream selection, persist that to the server as their choice - so the live player track is checked before applying and their newer decision wins. One attempt per item, claimed before any network call so a search that throws does not re-run on the next rebuild. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PQ9KU5JXvzTB7tkYyeDEut
This was referenced Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The second half of #2346. Stacked on #3026 — review that one first; this branch contains its commit because GitHub cannot base a cross-fork PR on another fork branch. I will rebase to a single commit once #3026 lands or closes.
What it does
Opt-in, Plex only. When an item carries no subtitle in the preferred language, search the server's online providers once and apply what comes back.
Deliberately silent
It runs without anyone pressing anything, often on a TV across the room, so a failure leaves playback exactly as it was and says so only in the log. The manual search sheet stays the place to find out what a provider does or does not have.
A spinner shows while the search, the server-side download and the metadata poll run — together that is seconds, and a viewer who asked for subtitles is otherwise watching an unsubtitled picture with no idea anything is coming. Success gets no toast: the subtitles are the confirmation and they arrive at the same moment.
Ranking, and why not score
Provider score alone picked wrong. Target (1985) returned a confidently-scored subtitle for an entirely different film with the same title. Score now only breaks ties between results that already agree on stronger evidence:
perfectMatch— comes from matching the file, not its name, so a shared title cannot fool it.Covered by
test/services/subtitle_auto_download_test.dart, including the Target case.The defect you found in #2346
Auto-download could override an explicit off. It could. The viewer turns subtitles off while the server is still fetching; applying then switches them back on, and because the apply path writes the stream selection, it persists that to the server as their choice. The live player track is now checked immediately before applying — read off the player, not from a carried preference, so any route that turned them off counts — and their newer decision wins.
One attempt per item, claimed before any network call so a search that throws does not re-run on the next rebuild.
Verified
10 files on top of #3026, +410/-15. English strings only.
Not verified by me: Plex only, and only against my own PMS providers. Jellyfin and Emby are gated out at the entry point (
capabilities.externalSubtitleSearch).🤖 Generated with Claude Code
https://claude.ai/code/session_01PQ9KU5JXvzTB7tkYyeDEut