From 6df36cd6a3707542f18b8e37132fa8858bd14acd Mon Sep 17 00:00:00 2001 From: shaun Date: Sun, 2 Aug 2015 16:24:15 +1000 Subject: [PATCH] always rebuild the nodes and create sources on a startup sync --- addon.xml | 2 +- resources/lib/LibrarySync.py | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/addon.xml b/addon.xml index 762a75eb..63b980ef 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ diff --git a/resources/lib/LibrarySync.py b/resources/lib/LibrarySync.py index d31ef56c..e99ad275 100644 --- a/resources/lib/LibrarySync.py +++ b/resources/lib/LibrarySync.py @@ -59,6 +59,14 @@ class LibrarySync(threading.Thread): def FullLibrarySync(self,manualRun=False): + ### BUILD VIDEO NODES LISTING ### + VideoNodes().buildVideoNodesListing() + ### CREATE SOURCES ### + if addon.getSetting("Sources") != "true": + # Only create sources once + self.logMsg("Sources.xml created.", 0) + utils.createSources() + addon.setSetting("Sources", "true") addon = xbmcaddon.Addon(id='plugin.video.emby') startupDone = WINDOW.getProperty("startup") == "done" @@ -112,17 +120,7 @@ class LibrarySync(threading.Thread): try: completed = True - - - ### BUILD VIDEO NODES LISTING ### - VideoNodes().buildVideoNodesListing() - ### CREATE SOURCES ### - if addon.getSetting("Sources") != "true": - # Only create sources once - self.logMsg("Sources.xml created.", 0) - utils.createSources() - addon.setSetting("Sources", "true") - + ### PROCESS VIDEO LIBRARY ### #create the sql connection to video db @@ -187,13 +185,14 @@ class LibrarySync(threading.Thread): if(pDialog != None): pDialog.close() - return True + return True + def SaveLastSync(self): # save last sync time addon = xbmcaddon.Addon(id='plugin.video.emby') lastSync = (datetime.utcnow() - timedelta(minutes=5)).strftime('%Y-%m-%dT%H:%M:%SZ') utils.logMsg("Sync Database", "Incremental Sync Setting Last Run Time Saved : " + lastSync, 0) - addon.setSetting("LastIncrenetalSync", lastSync) + addon.setSetting("LastIncrenetalSync", lastSync) def MoviesFullSync(self,connection,cursor, pDialog):