From 7c7b4b375f65b51a25841cf7a301190a0ab52c2e Mon Sep 17 00:00:00 2001 From: shaun Date: Sat, 21 Mar 2015 14:15:34 +1100 Subject: [PATCH] small changes to progress dialog and working of restart message --- resources/lib/LibrarySync.py | 20 +++++--------------- resources/lib/Utils.py | 2 +- resources/lib/WriteKodiDB.py | 4 ++-- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/resources/lib/LibrarySync.py b/resources/lib/LibrarySync.py index 6531956a..d3f2f834 100644 --- a/resources/lib/LibrarySync.py +++ b/resources/lib/LibrarySync.py @@ -136,7 +136,7 @@ class LibrarySync(): #initiate library update and wait for finish before processing any updates if updateNeeded: if(pDialog != None): - pDialog.update(0, "Processing Movie Updates", "Importing STRM Files") + pDialog.update(0, "Processing New Items", "Importing STRM Files") if(pDialog != None and type(pDialog) == xbmcgui.DialogProgressBG): pDialog.close() @@ -408,6 +408,9 @@ class LibrarySync(): #initiate library update and wait for finish before processing any updates if updateNeeded: + if(pDialog != None): + pDialog.update(0, "Processing New Items", "Importing STRM Files") + if(pDialog != None and type(pDialog) == xbmcgui.DialogProgressBG): pDialog.close() @@ -416,20 +419,7 @@ class LibrarySync(): if(pDialog != None and type(pDialog) == xbmcgui.DialogProgressBG): pDialog.create('Sync DB', 'Sync DB') - - - #initiate library update and wait for finish before processing any updates - if updateNeeded: - - if(pDialog != None and type(pDialog) == xbmcgui.DialogProgressBG): - pDialog.close() - - self.doKodiLibraryUpdate(False, pDialog) - updateNeeded = False - - if(pDialog != None and type(pDialog) == xbmcgui.DialogProgressBG): - pDialog.create('Sync DB', 'Sync DB') - + if(pDialog != None): progressTitle = "Sync DB : Processing TV Shows" pDialog.update(0, progressTitle, "") diff --git a/resources/lib/Utils.py b/resources/lib/Utils.py index 1d0701b5..9bdbacf2 100644 --- a/resources/lib/Utils.py +++ b/resources/lib/Utils.py @@ -70,7 +70,7 @@ def checkKodiSources(): rebootRequired = KodiAdvancedSettingsCheck() if rebootRequired: - ret = xbmcgui.Dialog().yesno(heading="Emby Sync service", line1="A restart of Kodi is needed to apply changes.", line2="Synchronisation will not start before the reboot.", line3="Do you want to reboot now ?") + ret = xbmcgui.Dialog().yesno(heading="Emby Sync service", line1="A restart of Kodi is needed to apply changes.", line2="Synchronisation will not start before the restart.", line3="Do you want to restart now?") if ret: xbmc.executebuiltin("RestartApp") else: diff --git a/resources/lib/WriteKodiDB.py b/resources/lib/WriteKodiDB.py index 6563e84a..7b96d01a 100644 --- a/resources/lib/WriteKodiDB.py +++ b/resources/lib/WriteKodiDB.py @@ -144,7 +144,7 @@ class WriteKodiDB(): # if there were movies changes then send the update via JSONRPC if(len(params) > 0): changes |= True - utils.logMsg("UpdateMovieParams", str(params), level = 0) + utils.logMsg("UpdateMovieParams", str(params), level = 2) jsoncommand = '{"jsonrpc": "2.0", "method": "VideoLibrary.SetMovieDetails", "params": { "movieid": %i, %s}, "id": 1 }' paramString = "" paramLen = len(params) @@ -154,7 +154,7 @@ class WriteKodiDB(): if(x < paramLen-1): paramString += ", " jsoncommand = jsoncommand %(KodiItem['movieid'], paramString) - utils.logMsg("executeJSONRPC : ", jsoncommand, level = 0) + utils.logMsg("executeJSONRPC : ", jsoncommand, level = 2) xbmc.sleep(sleepVal) result = xbmc.executeJSONRPC(jsoncommand)