if fast sync server plugin fails fall back to full sync and tell the user

This commit is contained in:
sfaulds 2016-11-28 18:23:49 +11:00
parent a9aad8fabc
commit ef4696ff2f
2 changed files with 3 additions and 2 deletions

View file

@ -352,5 +352,6 @@
<string id="33092">Create a backup</string> <string id="33092">Create a backup</string>
<string id="33093">Backup folder</string> <string id="33093">Backup folder</string>
<string id="33094">Select content type to repair</string> <string id="33094">Select content type to repair</string>
<string id="33095">Failed to retrieve latest updates using fast sync, using full sync.</string>
</strings> </strings>

View file

@ -136,9 +136,9 @@ class LibrarySync(threading.Thread):
if settings('enableMusic') != "true": if settings('enableMusic') != "true":
params['filter'] = "music" params['filter'] = "music"
url = "{server}/emby/Emby.Kodi.SyncQueue/{UserId}/GetItems?format=json" url = "{server}/emby/Emby.Kodi.SyncQueue/{UserId}/GetItems?format=json"
result = self.doUtils(url, parameters=params)
try: try:
result = self.doUtils(url, parameters=params)
processlist = { processlist = {
'added': result['ItemsAdded'], 'added': result['ItemsAdded'],
@ -149,13 +149,13 @@ class LibrarySync(threading.Thread):
except (KeyError, TypeError): except (KeyError, TypeError):
log.error("Failed to retrieve latest updates using fast sync.") log.error("Failed to retrieve latest updates using fast sync.")
xbmcgui.Dialog().ok(language(29999), language(33095))
return False return False
else: else:
log.info("Fast sync changes: %s" % result) log.info("Fast sync changes: %s" % result)
for action in processlist: for action in processlist:
self.triage_items(action, processlist[action]) self.triage_items(action, processlist[action])
return True return True
def saveLastSync(self): def saveLastSync(self):