From 8e70955ded8c7b402a74e9554f0a9b3bfeb1db8e Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Wed, 17 May 2017 15:27:32 +0200 Subject: [PATCH] Move check whether Kodi quit --- resources/lib/playqueue.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/lib/playqueue.py b/resources/lib/playqueue.py index 4cb6916e..45ca52b1 100644 --- a/resources/lib/playqueue.py +++ b/resources/lib/playqueue.py @@ -146,16 +146,16 @@ class Playqueue(Thread): index = list(range(0, len(old))) log.debug('Comparing new Kodi playqueue %s with our play queue %s' % (new, old)) + if self.thread_stopped(): + # Chances are that we got an empty Kodi playlist due to + # Kodi exit + return for i, new_item in enumerate(new): if (new_item['file'].startswith('plugin://') and not new_item['file'].startswith(PLUGIN)): # Ignore new media added by other addons continue for j, old_item in enumerate(old): - if self.thread_stopped(): - # Chances are that we got an empty Kodi playlist due to - # Kodi exit - return try: if (old_item.file.startswith('plugin://') and not old_item['file'].startswith(PLUGIN)):