From 30bc3f8a666a6777acad93d66d6f7cc18aa35bfd Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sat, 28 Apr 2018 19:59:23 -0700 Subject: [PATCH] Fix incorrect {action} for new device (Fixes Tautulli/Tautulli-Issues#63) --- plexpy/notification_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 0fb7d7d0..0a5b25d8 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -709,7 +709,7 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m 'server_machine_id': plexpy.CONFIG.PMS_IDENTIFIER, 'server_platform': plexpy.CONFIG.PMS_PLATFORM, 'server_version': plexpy.CONFIG.PMS_VERSION, - 'action': notify_action.lstrip('on_'), + 'action': notify_action.split('on_')[-1], 'week_number': arrow.now().isocalendar()[1], 'datestamp': arrow.now().format(date_format), 'timestamp': arrow.now().format(time_format), @@ -914,7 +914,7 @@ def build_server_notify_params(notify_action=None, **kwargs): 'server_platform': plexpy.CONFIG.PMS_PLATFORM, 'server_version': plexpy.CONFIG.PMS_VERSION, 'server_machine_id': plexpy.CONFIG.PMS_IDENTIFIER, - 'action': notify_action.lstrip('on_'), + 'action': notify_action.split('on_')[-1], 'datestamp': arrow.now().format(date_format), 'timestamp': arrow.now().format(time_format), 'unixtime': int(time.time()),