Merge while loops

This commit is contained in:
tomkat83 2016-09-17 09:48:38 +02:00
parent 8743ce13af
commit daf23fcc55

View file

@ -285,22 +285,13 @@ class ProcessFanartThread(Thread):
log.info("---===### Starting FanartSync ###===---") log.info("---===### Starting FanartSync ###===---")
while not threadStopped(): while not threadStopped():
# In the event the server goes offline # In the event the server goes offline
while threadSuspended(): while threadSuspended() or window('plex_dbScan'):
# Set in service.py # Set in service.py
if threadStopped(): if threadStopped():
# Abort was requested while waiting. We should exit # Abort was requested while waiting. We should exit
log.info("---===### Stopped FanartSync ###===---") log.info("---===### Stopped FanartSync ###===---")
return return
xbmc.sleep(1000) 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 # grabs Plex item from queue
try: try:
item = queue.get(block=False) item = queue.get(block=False)