From 53de8cda30aff854a0daf960c4fdd5fdfcc9e5a6 Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Sun, 6 Dec 2015 11:13:46 -0800 Subject: [PATCH 1/2] Match newline between tags for notification text --- 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 eaa8b777..4d4560de 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -315,13 +315,13 @@ def build_notify_text(session=None, timeline=None, state=None): # 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('[^>]+.|[^>]+.', re.IGNORECASE|re.DOTALL) + pattern = re.compile('\n*[^>]+.\n*|\n*[^>]+.\n*', 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('[^>]+.|[^>]+.', re.IGNORECASE|re.DOTALL) + pattern = re.compile('\n*[^>]+.\n*|\n*?[^>]+.\n*', 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('[^>]+.|[^>]+.', re.IGNORECASE|re.DOTALL) + pattern = re.compile('\n*[^>]+.\n*|\n*[^>]+.\n*', re.IGNORECASE|re.DOTALL) else: pattern = None From a3782f915013441489c48f9b4d25099b0ce1b0b1 Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Sun, 6 Dec 2015 11:30:33 -0800 Subject: [PATCH 2/2] Fix dict key for IP address in current activity --- plexpy/datafactory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plexpy/datafactory.py b/plexpy/datafactory.py index b3d73cde..8d797fae 100644 --- a/plexpy/datafactory.py +++ b/plexpy/datafactory.py @@ -1046,6 +1046,6 @@ class DataFactory(object): ip_address = 'N/A' for item in result: - ip_address = item[0] + ip_address = item['ip_address'] return ip_address