fix(tags): preserve Matroska LanguageBCP47 regions - #790
Open
maghuro wants to merge 2 commits into
Open
Conversation
Read embedded Matroska LanguageBCP47/LanguageIETF values directly when Jellyfin/FFmpeg exposes only the legacy base language. Use the region-aware language resolver in server cache and tag-data paths, preserve native Jellyfin values as a fail-safe fallback, and invalidate stale tag-cache entries via schema v3. Refs n00bcodr#789
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.
Summary
Preserves explicit Matroska
LanguageBCP47/LanguageIETFregional variants before they are lost by Jellyfin/FFmpeg, allowing the existing region-aware language flag resolver to receive values such aspt-BR,pt-PT,en-US, anden-GB.Fixes #789.
Root cause
Matroska can contain both a legacy
Languageelement (por,eng, etc.) and an authoritative BCP-47 language element (pt-BR,en-US, etc.).For the tested MKVToolNix files, FFmpeg/Jellyfin exposes only the legacy/base value through
MediaStream.Language. As a result, Jellyfin Enhanced never receives the regional tag even though its client-side flag resolver already understands it.Implementation
Tracks/TrackEntry; it does not scan media clusters.LanguageBCP47over the legacyLanguageelement.MediaStream.Languagefor unsupported, inaccessible, malformed, non-Matroska, or non-regional media./tag-datapath used when the server cache is disabled.Bare-language policy is intentionally unchanged. For example, an explicit
en-UScan resolve to the US flag, while bareengcontinues to follow Jellyfin Enhanced's existing default behavior.Testing
Runtime-tested on:
Verified with real Matroska files containing:
por+pt-PTpor+pt-BReng+en-USeng+en-GBVerified regional values in the rebuilt v3 server tag cache, including
pt-PT,pt-BR,en-US,en-GB,fr-CA, andes-419.Also verified the non-cache card path and item-details path, including Series/Season first-episode language resolution.
Build/static validation:
node --checkpassed for both modified JavaScript filesgit diff --checkpassedAI assistance
AI assistance was used during investigation and implementation; I reviewed and tested the changes and understand the implementation.