Merge pull request #647 from croneter/less_dialogs
Don't show a library sync error pop-up when full sync is interrupted
This commit is contained in:
commit
5f72d50ed0
2 changed files with 8 additions and 30 deletions
|
@ -415,6 +415,12 @@ class FullSync(common.fullsync_mixin):
|
||||||
self.dialog.close()
|
self.dialog.close()
|
||||||
if self.threader:
|
if self.threader:
|
||||||
self.threader.shutdown()
|
self.threader.shutdown()
|
||||||
|
if not self.successful and not self.isCanceled():
|
||||||
|
# "ERROR in library sync"
|
||||||
|
utils.dialog('notification',
|
||||||
|
heading='{plex}',
|
||||||
|
message=utils.lang(39410),
|
||||||
|
icon='{error}')
|
||||||
if self.callback:
|
if self.callback:
|
||||||
self.callback(self.successful)
|
self.callback(self.successful)
|
||||||
LOG.info('Done full_sync')
|
LOG.info('Done full_sync')
|
||||||
|
|
|
@ -43,31 +43,6 @@ class Sync(backgroundthread.KillableThread):
|
||||||
def isSuspended(self):
|
def isSuspended(self):
|
||||||
return self._suspended or app.APP.suspend_threads
|
return self._suspended or app.APP.suspend_threads
|
||||||
|
|
||||||
def show_kodi_note(self, message, icon="plex", force=False):
|
|
||||||
"""
|
|
||||||
Shows a Kodi popup, if user selected to do so. Pass message in unicode
|
|
||||||
or string
|
|
||||||
|
|
||||||
icon: "plex": shows Plex icon
|
|
||||||
"error": shows Kodi error icon
|
|
||||||
"""
|
|
||||||
if app.APP.player.isPlaying():
|
|
||||||
LOG.info('Playing media - not showing note: %s', message)
|
|
||||||
return
|
|
||||||
if not force and app.SYNC.sync_dialog is not True and self.force_dialog is not True:
|
|
||||||
return
|
|
||||||
if icon == "plex":
|
|
||||||
utils.dialog('notification',
|
|
||||||
heading='{plex}',
|
|
||||||
message=message,
|
|
||||||
icon='{plex}',
|
|
||||||
sound=False)
|
|
||||||
elif icon == "error":
|
|
||||||
utils.dialog('notification',
|
|
||||||
heading='{plex}',
|
|
||||||
message=message,
|
|
||||||
icon='{error}')
|
|
||||||
|
|
||||||
def triage_lib_scans(self):
|
def triage_lib_scans(self):
|
||||||
"""
|
"""
|
||||||
Decides what to do if app.SYNC.run_lib_scan has been set. E.g. manually
|
Decides what to do if app.SYNC.run_lib_scan has been set. E.g. manually
|
||||||
|
@ -81,7 +56,7 @@ class Sync(backgroundthread.KillableThread):
|
||||||
block=True)
|
block=True)
|
||||||
if not self.sync_successful and not self.isSuspended() and not self.isCanceled():
|
if not self.sync_successful and not self.isSuspended() and not self.isCanceled():
|
||||||
# ERROR in library sync
|
# ERROR in library sync
|
||||||
self.show_kodi_note(utils.lang(39410), icon='error')
|
LOG.warn('Triggered full/repair sync has not been successful')
|
||||||
elif app.SYNC.run_lib_scan == 'fanart':
|
elif app.SYNC.run_lib_scan == 'fanart':
|
||||||
# Only look for missing fanart (No) or refresh all fanart (Yes)
|
# Only look for missing fanart (No) or refresh all fanart (Yes)
|
||||||
from .windows import optionsdialog
|
from .windows import optionsdialog
|
||||||
|
@ -113,10 +88,7 @@ class Sync(backgroundthread.KillableThread):
|
||||||
self.last_full_sync = timing.unix_timestamp()
|
self.last_full_sync = timing.unix_timestamp()
|
||||||
set_library_scan_toggle(boolean=False)
|
set_library_scan_toggle(boolean=False)
|
||||||
if not successful:
|
if not successful:
|
||||||
LOG.error('Could not finish scheduled full sync')
|
LOG.warn('Could not finish scheduled full sync')
|
||||||
self.force_dialog = True
|
|
||||||
self.show_kodi_note(utils.lang(39410), icon='error')
|
|
||||||
self.force_dialog = False
|
|
||||||
# try:
|
# try:
|
||||||
# self.lock.release()
|
# self.lock.release()
|
||||||
# except backgroundthread.threading.ThreadError:
|
# except backgroundthread.threading.ThreadError:
|
||||||
|
|
Loading…
Add table
Reference in a new issue