From 60441f05c496dfb27a7092ac59afa7c409045ae2 Mon Sep 17 00:00:00 2001 From: imSp4rky Date: Thu, 14 May 2026 10:22:55 -0600 Subject: [PATCH] fix(title): detect Atmos across all audio tracks for filename template The {atmos?} placeholder checked only the first MediaInfo audio track, so a mux with a non-Atmos dub listed first dropped the Atmos tag from the filename even when another track carried JOC. Scan all audio tracks instead. --- unshackle/core/titles/title.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/unshackle/core/titles/title.py b/unshackle/core/titles/title.py index 97bcbfa..db444b3 100644 --- a/unshackle/core/titles/title.py +++ b/unshackle/core/titles/title.py @@ -145,12 +145,16 @@ class Title: features = primary_audio_track.format_additionalfeatures or "" + has_atmos = any( + "JOC" in (t.format_additionalfeatures or "") or t.joc for t in media_info.audio_tracks + ) + context.update( { "audio": AUDIO_CODEC_MAP.get(codec, codec), "audio_channels": f"{channels:.1f}", "audio_full": f"{AUDIO_CODEC_MAP.get(codec, codec)}{channels:.1f}", - "atmos": "Atmos" if ("JOC" in features or primary_audio_track.joc) else "", + "atmos": "Atmos" if has_atmos else "", } )