From f3e7ac350d9ccf97dae487c74169a6c8e648f7c6 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Thu, 7 May 2015 11:36:34 +0200 Subject: [PATCH] add full sync entry to main listing --- default.py | 3 +++ resources/lib/Entrypoint.py | 5 +++-- resources/lib/LibrarySync.py | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/default.py b/default.py index 78967113..92bf4c6d 100644 --- a/default.py +++ b/default.py @@ -50,6 +50,9 @@ elif mode == "adduser": elif mode == "settings": xbmc.executebuiltin('Addon.OpenSettings(plugin.video.emby)') +elif mode == "manualsync": + from LibrarySync import LibrarySync + LibrarySync().FullLibrarySync(True) ##### BROWSE EMBY CHANNELS ROOT ##### elif mode == "channels": diff --git a/resources/lib/Entrypoint.py b/resources/lib/Entrypoint.py index 4f25fd94..f4ebb0ff 100644 --- a/resources/lib/Entrypoint.py +++ b/resources/lib/Entrypoint.py @@ -424,10 +424,11 @@ def doMainListing(): if path: addDirectoryItem(label, path) - # some extra entries for settinsg and stuff. TODO --> localize the labels + # some extra entries for settings and stuff. TODO --> localize the labels addDirectoryItem("Settings", "plugin://plugin.video.emby/?mode=settings") + addDirectoryItem("Perform manual sync", "plugin://plugin.video.emby/?mode=manualsync") addDirectoryItem("Add user to session", "plugin://plugin.video.emby/?mode=adduser") - addDirectoryItem("Perform full resync", "plugin://plugin.video.emby/?mode=reset") + addDirectoryItem("Perform local database reset (full resync)", "plugin://plugin.video.emby/?mode=reset") xbmcplugin.endOfDirectory(int(sys.argv[1])) diff --git a/resources/lib/LibrarySync.py b/resources/lib/LibrarySync.py index 4e99dce3..1f9a493f 100644 --- a/resources/lib/LibrarySync.py +++ b/resources/lib/LibrarySync.py @@ -33,7 +33,7 @@ WINDOW = xbmcgui.Window( 10000 ) class LibrarySync(): - def FullLibrarySync(self): + def FullLibrarySync(self,manualRun=False): #set some variable to check if this is the first run addon = xbmcaddon.Addon(id='plugin.video.emby') @@ -46,7 +46,7 @@ class LibrarySync(): #show the progress dialog pDialog = None - if (syncInstallRunDone == False or dbSyncIndication): + if (syncInstallRunDone == False or dbSyncIndication or manualRun): pDialog = xbmcgui.DialogProgressBG() pDialog.create('Emby for Kodi', 'Performing full sync')