added loglevel from settings and exception to logmessages

This commit is contained in:
Marcel van der Veldt 2015-03-18 21:34:52 +01:00
parent b5214ad8ba
commit 200040dd62
2 changed files with 23 additions and 12 deletions

View file

@ -65,17 +65,18 @@ class LibrarySync():
WINDOW.setProperty("startup", "done")
return True
def MoviesSync(self, fullsync=True):
WINDOW = xbmcgui.Window( 10000 )
pDialog = None
try:
if(addon.getSetting("enableProgressFullSync")):
enableProgress = False
if addon.getSetting("enableProgressFullSync") == 'true':
enableProgress = True
if(enableProgress):
pDialog = xbmcgui.DialogProgressBG()
if(pDialog != None):
pDialog.create('Sync DB', 'Sync DB')
@ -193,6 +194,8 @@ class LibrarySync():
if(self.ShouldStop()):
return True
except Exception, msg:
print "Exception in MoviesSync --> " + str(msg)
finally:
if(pDialog != None):
pDialog.close()
@ -205,13 +208,14 @@ class LibrarySync():
pDialog = None
try:
if(addon.getSetting("enableProgressFullSync")):
enableProgress = False
if addon.getSetting("enableProgressFullSync") == 'true':
enableProgress = True
if(enableProgress):
pDialog = xbmcgui.DialogProgressBG()
if(pDialog != None):
pDialog.create('Sync DB', 'Sync DB')
# incremental sync --> new episodes only
if not fullsync:
latestMBEpisodes = ReadEmbyDB().getLatestEpisodes(True)
@ -432,6 +436,8 @@ class LibrarySync():
if(self.ShouldStop()):
return True
except Exception, msg:
print "Exception in TvShowsSync --> " + str(msg)
finally:
if(pDialog != None):
pDialog.close()
@ -458,7 +464,10 @@ class LibrarySync():
pDialog = None
try:
if(addon.getSetting("enableProgressPlayCountSync")):
enableProgress = False
if addon.getSetting("enableProgressPlayCountSync") == 'true':
enableProgress = True
if(enableProgress):
pDialog = xbmcgui.DialogProgressBG()
if(pDialog != None):
pDialog.create('Sync PlayCounts', 'Sync PlayCounts')
@ -547,7 +556,10 @@ class LibrarySync():
percentage = int(((float(count) / float(totalCount)) * 100))
pDialog.update(percentage, message="Updating Episode: " + str(count))
count += 1
except Exception, msg:
print "Exception in updatePlaycounts --> " + str(msg)
finally:
if(pDialog != None):
pDialog.close()

View file

@ -24,9 +24,8 @@ addonSettings = xbmcaddon.Addon(id='plugin.video.mb3sync')
language = addonSettings.getLocalizedString
def logMsg(title, msg, level = 1):
#todo --> get this from a setting
logLevel = 1
logLevel = int(addonSettings.getSetting("logLevel"))
if(logLevel >= level):
if(logLevel == 1):