From 91fe4f827dc2a02c30844650495da7c1b573aede Mon Sep 17 00:00:00 2001 From: croneter Date: Tue, 29 Jan 2019 08:03:05 +0100 Subject: [PATCH] Fix KeyError: u'kodi_fileid' for some Plex websocket messages --- resources/lib/library_sync/websocket.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/lib/library_sync/websocket.py b/resources/lib/library_sync/websocket.py index 17c53425..99039759 100644 --- a/resources/lib/library_sync/websocket.py +++ b/resources/lib/library_sync/websocket.py @@ -279,8 +279,12 @@ def process_playing(data): LOG.debug('Updated current sessions. They are: %s', PLAYSTATE_SESSIONS) # Attach Kodi info to the session + try: + PLAYSTATE_SESSIONS[session_key]['file_id'] = typus['kodi_fileid'] + except KeyError: + # media type without file - no need to do anything + continue PLAYSTATE_SESSIONS[session_key]['kodi_id'] = typus['kodi_id'] - PLAYSTATE_SESSIONS[session_key]['file_id'] = typus['kodi_fileid'] PLAYSTATE_SESSIONS[session_key]['kodi_type'] = typus['kodi_type'] session = PLAYSTATE_SESSIONS[session_key] if utils.settings('plex_serverowned') != 'false':