diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index b55ca4d2..aac8759a 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -364,8 +364,9 @@ def switchPlexUser(): "Plex home user switch requested", 0) # Pause library sync thread - user needs to be auth in order to sync utils.window('suspend_LibraryThread', value='true') - # Wait 1 second to ensure that library thread is indeed suspended - xbmc.sleep(1000) + # Wait to ensure that any sync already going on has finished + while utils.window('emby_dbScan' == 'true'): + xbmc.sleep(1000) # Log out currently signed in user: utils.window('emby_serverStatus', value="401") # Request lib sync to get user view data (e.g. watched/unwatched) diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index da7098c1..ddd67512 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -421,7 +421,6 @@ class LibrarySync(Thread): # Get current media folders from emby database view = emby_db.getView_byId(folderid) - self.logMsg("playlist: %s, nodes: %s, sorted_views: %s, folderid: %s, foldername: %s, viewtype: %s" % (playlists, nodes, sorted_views, folderid, foldername, viewtype)) try: current_viewname = view[0] current_viewtype = view[1] @@ -1228,12 +1227,6 @@ class LibrarySync(Thread): log('Running automatic full lib scan', 0) self.fullSync(manualrun=True) window('emby_dbScan', clear=True) - # Update views / PMS libraries approx. every 5min - elif count % 300 == 0: - log('Running maintainViews() scan', 0) - window('emby_dbScan', value="true") - self.maintainViews() - self.startSync() # Run fast sync otherwise (ever 2 seconds or so) else: self.startSync()