add full sync entry to main listing

This commit is contained in:
Marcel van der Veldt 2015-05-07 11:36:34 +02:00
parent 0cacd3ee87
commit f3e7ac350d
3 changed files with 8 additions and 4 deletions

View File

@ -50,6 +50,9 @@ elif mode == "adduser":
elif mode == "settings": elif mode == "settings":
xbmc.executebuiltin('Addon.OpenSettings(plugin.video.emby)') xbmc.executebuiltin('Addon.OpenSettings(plugin.video.emby)')
elif mode == "manualsync":
from LibrarySync import LibrarySync
LibrarySync().FullLibrarySync(True)
##### BROWSE EMBY CHANNELS ROOT ##### ##### BROWSE EMBY CHANNELS ROOT #####
elif mode == "channels": elif mode == "channels":

View File

@ -424,10 +424,11 @@ def doMainListing():
if path: if path:
addDirectoryItem(label, 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("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("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])) xbmcplugin.endOfDirectory(int(sys.argv[1]))

View File

@ -33,7 +33,7 @@ WINDOW = xbmcgui.Window( 10000 )
class LibrarySync(): class LibrarySync():
def FullLibrarySync(self): def FullLibrarySync(self,manualRun=False):
#set some variable to check if this is the first run #set some variable to check if this is the first run
addon = xbmcaddon.Addon(id='plugin.video.emby') addon = xbmcaddon.Addon(id='plugin.video.emby')
@ -46,7 +46,7 @@ class LibrarySync():
#show the progress dialog #show the progress dialog
pDialog = None pDialog = None
if (syncInstallRunDone == False or dbSyncIndication): if (syncInstallRunDone == False or dbSyncIndication or manualRun):
pDialog = xbmcgui.DialogProgressBG() pDialog = xbmcgui.DialogProgressBG()
pDialog.create('Emby for Kodi', 'Performing full sync') pDialog.create('Emby for Kodi', 'Performing full sync')