move data access to inside the try

This commit is contained in:
shaun 2015-09-05 18:35:46 +10:00
parent 3591d085af
commit b923eed55d

View file

@ -91,16 +91,14 @@ class LibrarySync(threading.Thread):
try: try:
results = du.downloadUrl(url) results = du.downloadUrl(url)
changedItems = results["ItemsUpdated"] + results["ItemsAdded"]
removedItems = results["ItemsRemoved"]
userChanges = results["UserDataChanged"]
except: except:
utils.logMsg("Sync Database", "Incremental Sync Get Changes Failed", 0) utils.logMsg("Sync Database", "Incremental Sync Get Changes Failed", 0)
pass pass
else: else:
utils.logMsg("Sync Database", "Incremental Sync Changes : " + str(results), 0) utils.logMsg("Sync Database", "Incremental Sync Changes : " + str(results), 0)
changedItems = results["ItemsUpdated"] + results["ItemsAdded"]
removedItems = results["ItemsRemoved"]
userChanges = results["UserDataChanged"]
if(len(changedItems) < 1000 and len(removedItems) < 1000 and len(userChanges) < 1000): if(len(changedItems) < 1000 and len(removedItems) < 1000 and len(userChanges) < 1000):
WINDOW.setProperty("startup", "done") WINDOW.setProperty("startup", "done")