From 8c4cc5aa29148d49cc30db0c8f58d5f23b9089e2 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Thu, 11 Mar 2021 00:51:01 -0500 Subject: [PATCH] fix for audio_track_title --- modules/plex.py | 16 ++++++++++------ modules/util.py | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/modules/plex.py b/modules/plex.py index 01bf58cc..2ed72f8f 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -152,17 +152,21 @@ class PlexAPI: match = False break elif method == "audio_track_title": + jailbreak = False for media in current.media: for part in media.parts: for audio in part.audioStreams(): for check_title in filter_data: - if (modifier == ".not" and check_title.lower() in audio.title.lower()) or (modifier != ".not" and check_title.lower() not in audio.title.lower()): - match = False + title = audio.title if audio.title else "" + if check_title.lower() in title.lower(): + jailbreak = True break - if match is False: break - if match is False: break - if match is False: break - if match is False: break + if jailbreak: break + if jailbreak: break + if jailbreak: break + if (jailbreak and modifier == ".not") or (not jailbreak and modifier != ".not"): + match = False + break elif modifier in [".gte", ".lte"]: if method == "vote_count": tmdb_item = None diff --git a/modules/util.py b/modules/util.py index 760cd31d..471f2067 100644 --- a/modules/util.py +++ b/modules/util.py @@ -37,6 +37,7 @@ method_alias = { filter_alias = { "actor": "actors", "audio_language": "audio_language", + "audio_track_title": "audio_track_title", "collection": "collections", "content_rating": "contentRating", "country": "countries",