From daf23fcc55d41ae12984c8d24f5b5e298985769c Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Sat, 17 Sep 2016 09:48:38 +0200 Subject: [PATCH] Merge while loops --- resources/lib/librarysync.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index d5ae345b..d342582f 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -285,22 +285,13 @@ class ProcessFanartThread(Thread): log.info("---===### Starting FanartSync ###===---") while not threadStopped(): # In the event the server goes offline - while threadSuspended(): + while threadSuspended() or window('plex_dbScan'): # Set in service.py if threadStopped(): # Abort was requested while waiting. We should exit log.info("---===### Stopped FanartSync ###===---") return xbmc.sleep(1000) - while window('plex_dbScan'): - # Don't do background sync if there is another sync - # going - otherwise we will have OperationalError for - # Kodi DB changes! - if threadStopped(): - # Abort was requested while waiting. We should exit - log.info("---===### Stopped FanartSync ###===---") - return - xbmc.sleep(1000) # grabs Plex item from queue try: item = queue.get(block=False)