From 4da0184294fdd859202266f9dd65ec173424fabb Mon Sep 17 00:00:00 2001 From: Audionut Date: Sun, 13 Oct 2024 08:28:48 +1000 Subject: [PATCH] Check if title string is present before applying lower --- src/prep.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/prep.py b/src/prep.py index d838d517a..678786f7f 100644 --- a/src/prep.py +++ b/src/prep.py @@ -1910,7 +1910,7 @@ def get_audio_v2(self, mi, meta, bdinfo): for i, t in enumerate(tracks): if t.get('@type') != "Audio": continue - if t.get('Language', '') == meta.get('original_language', '') and "commentary" not in t.get('Title', '').lower(): + if t.get('Language', '') == meta.get('original_language', '') and "commentary" not in (t.get('Title') or '').lower(): track_num = i break @@ -1962,11 +1962,11 @@ def get_audio_v2(self, mi, meta, bdinfo): audio_language = t.get('Language', '') # Check for English Language Track - if audio_language.startswith("en") and "commentary" not in t.get('Title', '').lower(): + if audio_language.startswith("en") and "commentary" not in (t.get('Title') or '').lower(): eng = True # Check for original Language Track - if not audio_language.startswith("en") and audio_language.startswith(meta['original_language']) and "commentary" not in t.get('Title', '').lower(): + if not audio_language.startswith("en") and audio_language.startswith(meta['original_language']) and "commentary" not in (t.get('Title') or '').lower(): orig = True # Catch Chinese / Norwegian Variants @@ -1993,7 +1993,7 @@ def get_audio_v2(self, mi, meta, bdinfo): if t.get('@type') != "Audio": continue - if "commentary" in t.get('Title', '').lower(): + if "commentary" in (t.get('Title') or '').lower(): has_commentary = True # Convert commercial name to naming conventions