From 108944c4b2a80ec85174ec67c60a0d2f8d3a83eb Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 24 Jun 2018 11:19:42 +0200 Subject: [PATCH] Fix LibrarySync crashing due to Plex Companion messages --- resources/lib/librarysync.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index 9a9e6373..f4426b1b 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -1024,12 +1024,18 @@ class LibrarySync(Thread): processes json.loads() messages from websocket. Triage what we need to do with "process_" methods """ - if message['type'] == 'playing': - self.process_playing(message['PlaySessionStateNotification']) - elif message['type'] == 'timeline': - self.process_timeline(message['TimelineEntry']) - elif message['type'] == 'activity': - self.process_activity(message['ActivityNotification']) + try: + if message['type'] == 'playing': + self.process_playing(message['PlaySessionStateNotification']) + elif message['type'] == 'timeline': + self.process_timeline(message['TimelineEntry']) + elif message['type'] == 'activity': + self.process_activity(message['ActivityNotification']) + except: + LOG.error('Processing of Plex Companion message has crashed') + LOG.error('Message was: %s', message) + import traceback + LOG.error("Traceback:\n%s", traceback.format_exc()) def multi_delete(self, liste, delete_list): """