diff --git a/resources/lib/KodiMonitor.py b/resources/lib/KodiMonitor.py index d9b22e8e..a2216eb0 100644 --- a/resources/lib/KodiMonitor.py +++ b/resources/lib/KodiMonitor.py @@ -27,6 +27,14 @@ class Kodi_Monitor( xbmc.Monitor ): className = self.__class__.__name__ utils.logMsg("%s %s" % ("EMBY", className), msg, int(lvl)) + + def onScanStarted(self, library): + utils.window('kodiScan', value="true") + self.logMsg("Kodi library scan running.", 2) + + def onScanFinished(self, library): + utils.window('kodiScan', clear=True) + self.logMsg("Kodi library scan finished.", 2) #this library monitor is used to detect a watchedstate change by the user through the library #as well as detect when a library item has been deleted to pass the delete to the Emby server diff --git a/resources/lib/LibrarySync.py b/resources/lib/LibrarySync.py index 61155ee4..c8ee381d 100644 --- a/resources/lib/LibrarySync.py +++ b/resources/lib/LibrarySync.py @@ -1108,21 +1108,21 @@ class LibrarySync(threading.Thread): - if len(self.updateItems) > 0: + if len(self.updateItems) > 0 and utils.window('kodiScan') != "true": # Add or update items self.logMsg("Processing items: %s" % (str(self.updateItems)), 1) listItems = self.updateItems self.updateItems = [] self.IncrementalSync(listItems) - if len(self.userdataItems) > 0: + if len(self.userdataItems) > 0 and utils.window('kodiScan') != "true": # Process userdata changes only self.logMsg("Processing items: %s" % (str(self.userdataItems)), 1) listItems = self.userdataItems self.userdataItems = [] self.setUserdata(listItems) - if len(self.removeItems) > 0: + if len(self.removeItems) > 0 and utils.window('kodiScan') != "true": # Remove item from Kodi library self.logMsg("Removing items: %s" % self.removeItems, 1) listItems = self.removeItems