From a3a62b1d94fa03c9610c2acd501035f40884597e Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sat, 7 May 2016 08:43:05 -0700 Subject: [PATCH] Add lazy quantifier to notifications media tag regex --- plexpy/notification_handler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 4286b130..690bc575 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -492,13 +492,13 @@ def build_notify_text(session=None, timeline=None, notify_action=None, agent_id= # Check for exclusion tags if metadata['media_type'] == 'movie': # Regex pattern to remove the text in the tags we don't want - pattern = re.compile(r'||.*|.*', re.IGNORECASE | re.DOTALL) + pattern = re.compile(r'||.*?|.*?', re.IGNORECASE | re.DOTALL) elif metadata['media_type'] == 'show' or metadata['media_type'] == 'episode': # Regex pattern to remove the text in the tags we don't want - pattern = re.compile(r'.*|||.*', re.IGNORECASE | re.DOTALL) + pattern = re.compile(r'.*?|||.*?', re.IGNORECASE | re.DOTALL) elif metadata['media_type'] == 'artist' or metadata['media_type'] == 'track': # Regex pattern to remove the text in the tags we don't want - pattern = re.compile(r'.*|.*||', re.IGNORECASE | re.DOTALL) + pattern = re.compile(r'.*?|.*?||', re.IGNORECASE | re.DOTALL) else: pattern = None