From c55b687495785b41892592fb4481266954f83ddb Mon Sep 17 00:00:00 2001 From: croneter Date: Thu, 15 Feb 2018 16:45:34 +0100 Subject: [PATCH] Catch PlaylistError in PlayqueueMonitor --- resources/lib/playqueue.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/resources/lib/playqueue.py b/resources/lib/playqueue.py index 46b04af2..8d5756c0 100644 --- a/resources/lib/playqueue.py +++ b/resources/lib/playqueue.py @@ -184,15 +184,20 @@ class PlayqueueMonitor(Thread): else: LOG.debug('Detected new Kodi element at position %s: %s ', i, new_item) - if playqueue.id is None: - PL.init_Plex_playlist(playqueue, - kodi_item=new_item) + try: + if playqueue.id is None: + PL.init_Plex_playlist(playqueue, + kodi_item=new_item) + else: + PL.add_item_to_PMS_playlist(playqueue, + i, + kodi_item=new_item) + except PL.PlaylistError: + # Could not add the element + pass else: - PL.add_item_to_PMS_playlist(playqueue, - i, - kodi_item=new_item) - for j in range(i, len(index)): - index[j] += 1 + for j in range(i, len(index)): + index[j] += 1 for i in reversed(index): if self.stopped(): # Chances are that we got an empty Kodi playlist due to