Monitor Kodi setting changes more closely

This commit is contained in:
tomkat83 2016-10-23 17:10:34 +02:00
parent 2557260002
commit a0b8a9fa93

View file

@ -45,15 +45,17 @@ class KodiMonitor(xbmc.Monitor):
""" """
Monitor the PKC settings for changes made by the user Monitor the PKC settings for changes made by the user
""" """
currentLog = settings('logLevel') # settings: window-variable
if window('plex_logLevel') != currentLog: items = {
# The log level changed, set new prop 'logLevel': 'plex_logLevel',
log.debug("New log level: %s" % currentLog) 'enableContext': 'plex_context',
window('plex_logLevel', value=currentLog) 'plex_restricteduser': 'plex_restricteduser'
current_context = "true" if settings('enableContext') == "true" else "" }
if window('plex_context') != current_context: for settings_value, window_value in items.iteritems():
log.info("New context setting: %s", current_context) if window(window_value) != settings(settings_value):
window('plex_context', value=current_context) log.debug('PKC settings changed: %s is now %s'
% (settings_value, settings(settings_value)))
window(window_value, value=settings(settings_value))
@CatchExceptions(warnuser=False) @CatchExceptions(warnuser=False)
def onNotification(self, sender, method, data): def onNotification(self, sender, method, data):