Repository navigation
Audio: one language precedence for every pick, and the file's default outranks a built-in English - #210
Merged
Conversation
With no Plex language preference, the direct-play ladder picked any direct-playable English track ahead of the file's default-flagged one, and the re-encode path chained a hard-coded "eng" after the show's language. A French user's French-default MKVs opened in English whenever an English track existed (#202). The precedence now lives in one place, audio_intent: a real per-part pick (selected, not the default echo) > the Plex language preferences in order (AudioLangPrefs; today the show's audioLanguage, the account default slots in after it) > the file's default. The direct-play pick and the remux/re-encode pick both resolve that one answer and differ only in how they carry it: - direct play: the pick if direct-playable, else a direct-playable track in its language; a preference's direct-playable track; then the file's default; then any direct-playable track; - re-encode: the pick itself; the preference's track (keeping the direct-play pick when it is already in that language); otherwise the direct-play pick, so a quality drop keeps the language. This also closes a disagreement between the two paths: a non-playable real pick (English DTS) with a show preference used to direct-play the show's language while a re-encode named the DTS. PREF_AUDIO_LANG is gone, and a show setting of "-1" (Account default) is now unset like "". Refs #202, #203 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… test Review follow-up. audio_intent returned a single answer, so a real pick that direct play could not carry (French DTS, no playable French track) skipped the show's language and fell straight to the file's default. audio_intents now returns the whole ranking (pick > preferences in order > file default) and both the direct-play and the remux/re-encode pick take the first entry they can carry. A picked stream's sibling was matched by raw code equality, so a `fre` pick missed its `fra` sibling. lang_matches now compares any two tags (preference or stream code) over one spelling table, and serves both. Refs #203 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
GLinnik21
added a commit
that referenced
this pull request
Sep 24, 2026
…evice-pass fixes, release note and audit (#233) Ports the three release/v0.6 fixes that never reached trunk (ambiguous bare IPv6 redaction, webOS/hardware context on handled playback events, crash-log mark identity binding and bounded read); discloses what offline mode keeps per profile in PRIVACY.md and the in-app Privacy page; fixes the replay-after-EOS dev arm (regression from 235e519), the harness batch abort on a missing stored sign-in, audio_switch_native's pre-#210 premise, and stale C objects when src/config.local.h disappears; grades the storage helper's firmware compatibility for releases; adds the v0.7.0 release note and audit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
With no Plex language preference, the audio pick ranked any direct-playable English track above the file's default-flagged track. The re-encode pick also fell back to a hard-coded
"eng"after the show's language. So a French user's French-default MKVs opened in English whenever an English track existed (#202).What changed
audio_intents(route/plan.rs) ranks what an audio pick honours: a real per-part pick (selectedand not the default echo) > the Plex language preferences in order (AudioLangPrefs, which holds only the show'saudioLanguagefor now) > the file's default. Every path walks that ranking and takes the first entry it can carry:pick_dp_audio_pref): the pick if it can direct-play, else a direct-playable track in its language; a preference's direct-playable track; the file's default; then any direct-playable track;encode_audio_id): the pick itself (DTS gets encoded); the preference's track, keeping the direct-play pick when it is already in that language; otherwise the direct-play pick, so a quality drop keeps the language./decisionand the remux probe use the direct-play result.PREF_AUDIO_LANGis gone, so there is no built-in language anywhere.lang_matchesnow compares any two tags over one spelling table, so afrepick finds itsfrasibling.audioLanguage/subtitleLanguageof"-1"(Plex's "Account default") is now unset, the same as"".Subtitles were checked. They have no built-in language: the server's selection wins, then the show's language and mode, otherwise subtitles stay off.
Not in this PR: the account's
defaultAudioLanguageThis PR does not yet do #203's step 3 (the account default). It needs more than a contained change. A managed Home profile's plex.tv token is dropped right after the switch:
auth.rsuses it for one/api/v2/resourcesand never stores it (see theSession::account_tokendoc).UserRef.tokenis the PMS token. So the resolve cannot ask plex.tv for the active profile's/api/v2/userwithout the session layer keeping either that token or the preference. Doing that means a persistedUserRef/profile field, the switch path inauth.rs, and a refresh on profile change. Once it lands, it fits into this PR's mechanism as one moreAudioLangPrefsfield, aftershow.Tests
the_files_default_track_wins_without_a_language_preference,a_reencode_without_a_preference_keeps_the_files_default_languageanda_non_playable_pick_is_answered_by_a_sibling_in_its_languageall FAILED (English chosen); they pass now.a_real_pick_outranks_the_show_language_on_every_path,an_uncarriable_pick_falls_to_the_show_language_before_the_default,a_picks_sibling_matches_across_iso_639_spellings,an_account_default_show_setting_is_no_preference. The English-assuming tests (ladder table, re-encode, and the twobuild_stream720p tests) were rewritten for the file-default rule.route::167 passed;--no-default-featurescheck is clean;make checkpassed 4201 / 4252 / 101 with 0 failed.Codex review
Two rounds (gpt-6-astra, high).
env.audio_sidinto the ranking: it is session continuity for a mid-play re-encode, not a language preference;build_stream-level preference test: the fixture PMS serves noSetting[], and the precedence is covered on the pure functions.Refs #203 (the account-default half stays open; see above)
Closes #202
🤖 Generated with Claude Code