Fix fanart download message showing up too often

This commit is contained in:
croneter 2018-11-13 16:30:05 +01:00
parent a566dc566d
commit b2615c19bd
2 changed files with 7 additions and 3 deletions

View file

@ -44,6 +44,7 @@ class FanartThread(backgroundthread.KillableThread):
def _run_internal(self):
LOG.info('Starting FanartThread')
finished = False
while True:
with PlexDB() as plexdb:
func = plexdb.every_plex_id if self.refresh else plexdb.missing_fanart
@ -52,8 +53,11 @@ class FanartThread(backgroundthread.KillableThread):
if self.isCanceled() or self.isSuspended():
break
process_fanart(plex_id, typus, self.refresh)
if self.isCanceled() or self.isSuspended():
break
else:
# Done processing!
finished = True
break
# Need to have these outside our DB context to close the connection
if self.isCanceled():
@ -63,7 +67,7 @@ class FanartThread(backgroundthread.KillableThread):
return
xbmc.sleep(1000)
LOG.info('FanartThread finished')
self.callback()
self.callback(finished)
class FanartTask(backgroundthread.Task, common.libsync_mixin):

View file

@ -151,9 +151,9 @@ class Sync(backgroundthread.KillableThread):
LOG.info('Still downloading fanart')
return False
def on_fanart_download_finished(self):
def on_fanart_download_finished(self, successful):
# FanartTV lookup completed
if state.SYNC_DIALOG:
if successful and state.SYNC_DIALOG:
utils.dialog('notification',
heading='{plex}',
message=utils.lang(30019),