mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-01-24 08:56:10 +00:00
Catch toggling screensaver error
This commit is contained in:
parent
70fba1a2c3
commit
106def9014
1 changed files with 9 additions and 22 deletions
|
@ -225,32 +225,19 @@ def querySQL(query, args=None, cursor=None, conntype=None):
|
||||||
|
|
||||||
def getScreensaver():
|
def getScreensaver():
|
||||||
# Get the current screensaver value
|
# Get the current screensaver value
|
||||||
query = {
|
result = JSONRPC('Settings.getSettingValues').execute({'setting': "screensaver.mode"})
|
||||||
|
try:
|
||||||
'jsonrpc': "2.0",
|
return result['result']['value']
|
||||||
'id': 0,
|
except KeyError:
|
||||||
'method': "Settings.getSettingValue",
|
return ""
|
||||||
'params': {
|
|
||||||
|
|
||||||
'setting': "screensaver.mode"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return json.loads(xbmc.executeJSONRPC(json.dumps(query)))['result']['value']
|
|
||||||
|
|
||||||
def setScreensaver(value):
|
def setScreensaver(value):
|
||||||
# Toggle the screensaver
|
# Toggle the screensaver
|
||||||
query = {
|
params = {
|
||||||
|
|
||||||
'jsonrpc': "2.0",
|
|
||||||
'id': 0,
|
|
||||||
'method': "Settings.setSettingValue",
|
|
||||||
'params': {
|
|
||||||
|
|
||||||
'setting': "screensaver.mode",
|
'setting': "screensaver.mode",
|
||||||
'value': value
|
'value': value
|
||||||
}
|
}
|
||||||
}
|
result = JSONRPC('Settings.setSettingValue').execute(params)
|
||||||
result = xbmc.executeJSONRPC(json.dumps(query))
|
|
||||||
log.info("Toggling screensaver: %s %s" % (value, result))
|
log.info("Toggling screensaver: %s %s" % (value, result))
|
||||||
|
|
||||||
def convertDate(date):
|
def convertDate(date):
|
||||||
|
|
Loading…
Reference in a new issue