From b39e7bbb6d1209e526c37cca48dd463c0ad0e4c6 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Fri, 4 Mar 2016 22:50:21 -0800 Subject: [PATCH] Do not strip newlines from notification text * Behaviour is more predictable this way --- 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 08520cdd..7ac89fd9 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -501,13 +501,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('\n*[^>]+.\n*|\n*[^>]+.\n*', re.IGNORECASE | re.DOTALL) + pattern = re.compile(r'[^>]+.<\/tv>|[^>]+.<\/music>', 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('\n*[^>]+.\n*|\n*?[^>]+.\n*', re.IGNORECASE | re.DOTALL) + pattern = re.compile(r'[^>]+.<\/movie>|[^>]+.<\/music>', 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('\n*[^>]+.\n*|\n*[^>]+.\n*', re.IGNORECASE | re.DOTALL) + pattern = re.compile(r'[^>]+.<\/tv>|[^>]+.<\/movie>', re.IGNORECASE | re.DOTALL) else: pattern = None