From cc9d09bd54220152163dbca55c52eebfeedb446b Mon Sep 17 00:00:00 2001 From: Tim Date: Sun, 6 Dec 2015 20:49:00 +0200 Subject: [PATCH 1/5] Allow HTML encoded content to be displayed in notification setting descriptions. --- data/interfaces/default/notification_config.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/interfaces/default/notification_config.html b/data/interfaces/default/notification_config.html index 7d420259..9d8ab9a1 100644 --- a/data/interfaces/default/notification_config.html +++ b/data/interfaces/default/notification_config.html @@ -25,7 +25,7 @@ from plexpy import helpers % endif -

${item['description']}

+

${item['description'] | n}

% elif item['input_type'] == 'button':
@@ -34,14 +34,14 @@ from plexpy import helpers
-

${item['description']}

+

${item['description'] | n}

% elif item['input_type'] == 'checkbox':
-

${item['description']}

+

${item['description'] | n}

% elif item['input_type'] == 'select': @@ -60,7 +60,7 @@ from plexpy import helpers -

${item['description']}

+

${item['description'] | n}

% endif % endfor From 1fb7473dc5b60178e4013d88303f938412bafad0 Mon Sep 17 00:00:00 2001 From: Tim Date: Sun, 6 Dec 2015 21:04:33 +0200 Subject: [PATCH 2/5] Sanitize sync row items. --- plexpy/plextv.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plexpy/plextv.py b/plexpy/plextv.py index 1c6682a1..8d4796c6 100644 --- a/plexpy/plextv.py +++ b/plexpy/plextv.py @@ -342,13 +342,13 @@ class PlexTV(object): rating_key = clean_uri.rpartition('%2F')[-1] - sync_details = {"device_name": device_name, - "platform": device_platform, - "username": device_username, - "friendly_name": device_friendly_name, + sync_details = {"device_name": helpers.sanitize(device_name), + "platform": helpers.sanitize(device_platform), + "username": helpers.sanitize(device_username), + "friendly_name": helpers.sanitize(device_friendly_name), "user_id": device_user_id, - "root_title": sync_root_title, - "title": sync_title, + "root_title": helpers.sanitize(sync_root_title), + "title": helpers.sanitize(sync_title), "metadata_type": sync_metadata_type, "content_type": sync_content_type, "rating_key": rating_key, From 53de8cda30aff854a0daf960c4fdd5fdfcc9e5a6 Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Sun, 6 Dec 2015 11:13:46 -0800 Subject: [PATCH 3/5] 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 4/5] 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 From 8db891cfe63b4b5ec5d704b7bbeca4420bc8d479 Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Sun, 6 Dec 2015 11:38:23 -0800 Subject: [PATCH 5/5] v1.2.13 --- CHANGELOG.md | 6 ++++++ plexpy/version.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 138f0ebe..b03ca181 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v1.2.12 (2015-12-06) + +* Fix match newlines between tags in notification text. +* Fix current activity not showing on PMS 0.9.12. + + ## v1.2.12 (2015-12-06) * Fix for "too many open files" error. diff --git a/plexpy/version.py b/plexpy/version.py index 022a6bf9..446464e0 100644 --- a/plexpy/version.py +++ b/plexpy/version.py @@ -1,2 +1,2 @@ PLEXPY_VERSION = "master" -PLEXPY_RELEASE_VERSION = "1.2.12" +PLEXPY_RELEASE_VERSION = "1.2.13"