From 48dc22ee353be2552bb266cfb1186483d7d5f20e Mon Sep 17 00:00:00 2001 From: croneter Date: Sat, 3 Feb 2018 14:59:43 +0100 Subject: [PATCH] Fix PlaylistError --- resources/lib/kodimonitor.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 7a027283..c0fe71fc 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -375,13 +375,18 @@ class KodiMonitor(Monitor): except RuntimeError: return LOG.info('Need to initialize Plex and PKC playqueue') - if plex_id: - item = PL.init_Plex_playlist(playqueue, plex_id=plex_id) - else: - item = PL.init_Plex_playlist(playqueue, - kodi_item={'id': kodi_id, - 'type': kodi_type, - 'file': path}) + try: + if plex_id: + item = PL.init_Plex_playlist(playqueue, plex_id=plex_id) + else: + item = PL.init_Plex_playlist(playqueue, + kodi_item={'id': kodi_id, + 'type': kodi_type, + 'file': path}) + except PL.PlaylistError: + LOG.info('Could not initialize our playlist') + # Avoid errors + item = PL.Playlist_Item() # Set the Plex container key (e.g. using the Plex playqueue) container_key = None if info['playlistid'] != -1: