mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-27 11:25:08 +00:00
fix(tracks): keep regional language variants distinct in exact selection
by_language now applies RFC 4647 Lookup in exact mode, preferring the string-equal tag so --exact-lang separates base/regional pairs (ar/ar-EG, en/en-US) instead of collapsing them, and dedupes by id to prevent the duplicate-track-id crash. Adds a language-selection regression test.
This commit is contained in:
@@ -61,9 +61,7 @@ class Title:
|
||||
returned dict with their specific fields (e.g., season/episode).
|
||||
"""
|
||||
primary_video_track = next(iter(media_info.video_tracks), None)
|
||||
original_lang_tag = (
|
||||
str(self.language).split("-")[0].lower() if self.language else ""
|
||||
)
|
||||
original_lang_tag = str(self.language).split("-")[0].lower() if self.language else ""
|
||||
primary_audio_track = None
|
||||
if original_lang_tag:
|
||||
primary_audio_track = next(
|
||||
@@ -170,9 +168,7 @@ class Title:
|
||||
channel_count = primary_audio_track.channel_s or primary_audio_track.channels or 0
|
||||
channels = float(channel_count)
|
||||
|
||||
has_atmos = any(
|
||||
"JOC" in (t.format_additionalfeatures or "") or t.joc for t in media_info.audio_tracks
|
||||
)
|
||||
has_atmos = any("JOC" in (t.format_additionalfeatures or "") or t.joc for t in media_info.audio_tracks)
|
||||
|
||||
context.update(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user