Fix fanart download message showing up too often
This commit is contained in:
parent
a566dc566d
commit
b2615c19bd
2 changed files with 7 additions and 3 deletions
|
@ -44,6 +44,7 @@ class FanartThread(backgroundthread.KillableThread):
|
||||||
|
|
||||||
def _run_internal(self):
|
def _run_internal(self):
|
||||||
LOG.info('Starting FanartThread')
|
LOG.info('Starting FanartThread')
|
||||||
|
finished = False
|
||||||
while True:
|
while True:
|
||||||
with PlexDB() as plexdb:
|
with PlexDB() as plexdb:
|
||||||
func = plexdb.every_plex_id if self.refresh else plexdb.missing_fanart
|
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():
|
if self.isCanceled() or self.isSuspended():
|
||||||
break
|
break
|
||||||
process_fanart(plex_id, typus, self.refresh)
|
process_fanart(plex_id, typus, self.refresh)
|
||||||
|
if self.isCanceled() or self.isSuspended():
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
# Done processing!
|
# Done processing!
|
||||||
|
finished = True
|
||||||
break
|
break
|
||||||
# Need to have these outside our DB context to close the connection
|
# Need to have these outside our DB context to close the connection
|
||||||
if self.isCanceled():
|
if self.isCanceled():
|
||||||
|
@ -63,7 +67,7 @@ class FanartThread(backgroundthread.KillableThread):
|
||||||
return
|
return
|
||||||
xbmc.sleep(1000)
|
xbmc.sleep(1000)
|
||||||
LOG.info('FanartThread finished')
|
LOG.info('FanartThread finished')
|
||||||
self.callback()
|
self.callback(finished)
|
||||||
|
|
||||||
|
|
||||||
class FanartTask(backgroundthread.Task, common.libsync_mixin):
|
class FanartTask(backgroundthread.Task, common.libsync_mixin):
|
||||||
|
|
|
@ -151,9 +151,9 @@ class Sync(backgroundthread.KillableThread):
|
||||||
LOG.info('Still downloading fanart')
|
LOG.info('Still downloading fanart')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def on_fanart_download_finished(self):
|
def on_fanart_download_finished(self, successful):
|
||||||
# FanartTV lookup completed
|
# FanartTV lookup completed
|
||||||
if state.SYNC_DIALOG:
|
if successful and state.SYNC_DIALOG:
|
||||||
utils.dialog('notification',
|
utils.dialog('notification',
|
||||||
heading='{plex}',
|
heading='{plex}',
|
||||||
message=utils.lang(30019),
|
message=utils.lang(30019),
|
||||||
|
|
Loading…
Reference in a new issue