diff --git a/addon.xml b/addon.xml index f0557c63..a91696b9 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ diff --git a/changelog.txt b/changelog.txt index d8a3d486..03f8f2c7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,10 @@ +version 2.2.7 +- Prevent Kodi screensaver during the initial sync + +version 2.2.6 +- Fix unicode error +- Fix grouped folders error + version 2.2.5 - Add generate a new device Id option, found in the add-on settings > advanced. - Offer to delete cached thumbnails upon database reset. diff --git a/resources/lib/utils.py b/resources/lib/utils.py index fdbab319..d618e77b 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -4,6 +4,7 @@ import cProfile import inspect +import json import pstats import sqlite3 from datetime import datetime, time, timedelta @@ -271,6 +272,40 @@ def getKodiMusicDBPath(): % dbVersion.get(kodibuild, "")).decode('utf-8') return dbPath +def getScreensaver(): + # Get the current screensaver value + query = { + + 'jsonrpc': "2.0", + 'id': 0, + 'method': "Settings.getSettingValue", + 'params': { + + 'setting': "screensaver.mode" + } + } + result = xbmc.executeJSONRPC(json.dumps(query)) + result = json.loads(result) + screensaver = result['result']['value'] + + return screensaver + +def setScreensaver(value): + # Toggle the screensaver + query = { + + 'jsonrpc': "2.0", + 'id': 0, + 'method': "Settings.setSettingValue", + 'params': { + + 'setting': "screensaver.mode", + 'value': value + } + } + result = xbmc.executeJSONRPC(json.dumps(query)) + logMsg("EMBY", "Toggling screensaver: %s %s" % (value, result), 1) + def reset(): dialog = xbmcgui.Dialog()