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.
This commit is contained in:
imSp4rky
2026-05-14 10:22:55 -06:00
parent 82ab996777
commit 60441f05c4

View File

@@ -145,12 +145,16 @@ class Title:
features = primary_audio_track.format_additionalfeatures or "" 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( context.update(
{ {
"audio": AUDIO_CODEC_MAP.get(codec, codec), "audio": AUDIO_CODEC_MAP.get(codec, codec),
"audio_channels": f"{channels:.1f}", "audio_channels": f"{channels:.1f}",
"audio_full": f"{AUDIO_CODEC_MAP.get(codec, codec)}{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 "",
} }
) )