Adjust librarysync notifications
This commit is contained in:
parent
fa8c6e49b8
commit
f162b6ea8a
1 changed files with 26 additions and 19 deletions
|
@ -217,12 +217,23 @@ class LibrarySync(Thread):
|
||||||
|
|
||||||
self.installSyncDone = True if \
|
self.installSyncDone = True if \
|
||||||
utils.settings('SyncInstallRunDone') == 'true' else False
|
utils.settings('SyncInstallRunDone') == 'true' else False
|
||||||
|
|
||||||
self.showDbSync = True if \
|
self.showDbSync = True if \
|
||||||
utils.settings('dbSyncIndicator') == 'true' else False
|
utils.settings('dbSyncIndicator') == 'true' else False
|
||||||
|
|
||||||
Thread.__init__(self)
|
Thread.__init__(self)
|
||||||
|
|
||||||
|
def showKodiNote(self, message, forced=False):
|
||||||
|
"""
|
||||||
|
Shows a Kodi popup, if user selected to do so
|
||||||
|
"""
|
||||||
|
if not (self.showDbSync or forced):
|
||||||
|
return
|
||||||
|
xbmcgui.Dialog().notification(
|
||||||
|
heading=self.addonName,
|
||||||
|
message=message,
|
||||||
|
icon="special://home/addons/plugin.video.plexkodiconnect/icon.png",
|
||||||
|
sound=False)
|
||||||
|
|
||||||
def startSync(self):
|
def startSync(self):
|
||||||
utils.window('emby_dbScan', value="true")
|
utils.window('emby_dbScan', value="true")
|
||||||
completed = self.fastSync()
|
completed = self.fastSync()
|
||||||
|
@ -408,12 +419,9 @@ class LibrarySync(Thread):
|
||||||
elapsedtotal = datetime.now() - starttotal
|
elapsedtotal = datetime.now() - starttotal
|
||||||
|
|
||||||
utils.window('emby_initialScan', clear=True)
|
utils.window('emby_initialScan', clear=True)
|
||||||
xbmcgui.Dialog().notification(
|
self.showKodiNote("%s completed in: %s"
|
||||||
heading=self.addonName,
|
% (message, str(elapsedtotal).split('.')[0]))
|
||||||
message="%s completed in: %s"
|
|
||||||
% (message, str(elapsedtotal).split('.')[0]),
|
|
||||||
icon="special://home/addons/plugin.video.plexkodiconnect/icon.png",
|
|
||||||
sound=False)
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def processView(self, folderItem, kodi_db, emby_db, totalnodes):
|
def processView(self, folderItem, kodi_db, emby_db, totalnodes):
|
||||||
|
@ -678,15 +686,17 @@ class LibrarySync(Thread):
|
||||||
threads.append(thread)
|
threads.append(thread)
|
||||||
self.logMsg("Processing thread spawned", 1)
|
self.logMsg("Processing thread spawned", 1)
|
||||||
# Start one thread to show sync progress
|
# Start one thread to show sync progress
|
||||||
dialog = xbmcgui.DialogProgressBG()
|
if self.showDbSync:
|
||||||
thread = ThreadedShowSyncInfo(dialog,
|
dialog = xbmcgui.DialogProgressBG()
|
||||||
[getMetadataLock, processMetadataLock],
|
thread = ThreadedShowSyncInfo(
|
||||||
itemNumber,
|
dialog,
|
||||||
itemType)
|
[getMetadataLock, processMetadataLock],
|
||||||
thread.setDaemon(True)
|
itemNumber,
|
||||||
thread.start()
|
itemType)
|
||||||
threads.append(thread)
|
thread.setDaemon(True)
|
||||||
self.logMsg("Kodi Infobox thread spawned", 1)
|
thread.start()
|
||||||
|
threads.append(thread)
|
||||||
|
self.logMsg("Kodi Infobox thread spawned", 1)
|
||||||
|
|
||||||
# Wait until finished
|
# Wait until finished
|
||||||
getMetadataQueue.join()
|
getMetadataQueue.join()
|
||||||
|
@ -705,9 +715,6 @@ class LibrarySync(Thread):
|
||||||
del threads
|
del threads
|
||||||
except:
|
except:
|
||||||
self.logMsg("Could not delete threads", -1)
|
self.logMsg("Could not delete threads", -1)
|
||||||
# Make sure dialog window is closed
|
|
||||||
if dialog:
|
|
||||||
dialog.close()
|
|
||||||
self.logMsg("Sync threads finished", 1)
|
self.logMsg("Sync threads finished", 1)
|
||||||
self.updatelist = []
|
self.updatelist = []
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in a new issue