From 57ec06ae4d507415af20fea598f991b400105cd7 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 4 Feb 2018 12:17:05 +0100 Subject: [PATCH] Don't empty entire playqueue on Kodi exit --- resources/lib/playqueue.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/lib/playqueue.py b/resources/lib/playqueue.py index 00a29f73..cf5a85e5 100644 --- a/resources/lib/playqueue.py +++ b/resources/lib/playqueue.py @@ -186,6 +186,10 @@ class PlayqueueMonitor(Thread): for j in range(i, len(index)): index[j] += 1 for i in reversed(index): + if self.thread_stopped(): + # Chances are that we got an empty Kodi playlist due to + # Kodi exit + return LOG.debug('Detected deletion of playqueue element at pos %s', i) PL.delete_playlist_item_from_PMS(playqueue, i) LOG.debug('Done comparing playqueues')