mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-01 15:07:49 +00:00
chrome: fix getting default audio device
Setting "audiooutput.audiodevice" was not found any more because settings format has be changed to version 2. Read the setting value via Kodi json RPC.
This commit is contained in:
parent
39978d99da
commit
d0a4824728
@ -1,3 +1,6 @@
|
||||
103
|
||||
- fix getting default audio device
|
||||
|
||||
102
|
||||
- add dark mode at options
|
||||
- support for latest Chrome
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
PKG_NAME="chrome"
|
||||
PKG_VERSION="1.0"
|
||||
PKG_REV="102"
|
||||
PKG_REV="103"
|
||||
PKG_ARCH="x86_64"
|
||||
PKG_LICENSE="Custom"
|
||||
PKG_SITE="http://www.google.com/chrome"
|
||||
|
@ -7,7 +7,7 @@ import sys
|
||||
import time
|
||||
import xbmcaddon
|
||||
import subprocess
|
||||
from xml.dom.minidom import parse
|
||||
import json
|
||||
|
||||
sys.path.append('/usr/share/kodi/addons/@DISTRO_PKG_SETTINGS_ID@')
|
||||
|
||||
@ -59,21 +59,22 @@ def isRuning(pname):
|
||||
return False
|
||||
|
||||
def getAudioDevice():
|
||||
try:
|
||||
dom = parse("/storage/.kodi/userdata/guisettings.xml")
|
||||
audiooutput=dom.getElementsByTagName('audiooutput')
|
||||
for node in audiooutput:
|
||||
dev = node.getElementsByTagName('audiodevice')[0].childNodes[0].nodeValue
|
||||
if dev.startswith("ALSA:"):
|
||||
dev = dev.split("ALSA:")[1]
|
||||
if dev == "@":
|
||||
return None
|
||||
if dev.startswith("@:"):
|
||||
dev = dev.split("@:")[1]
|
||||
else:
|
||||
# not ALSA
|
||||
dev = json.loads(xbmc.executeJSONRPC(json.dumps({
|
||||
"jsonrpc": "2.0",
|
||||
"method": "Settings.GetSettingValue",
|
||||
"params": {
|
||||
"setting": "audiooutput.audiodevice",
|
||||
},
|
||||
"id": 1,
|
||||
})))['result']['value']
|
||||
if dev.startswith("ALSA:"):
|
||||
dev = dev.split("ALSA:")[1]
|
||||
if dev == "@":
|
||||
return None
|
||||
except:
|
||||
if dev.startswith("@:"):
|
||||
dev = dev.split("@:")[1]
|
||||
else:
|
||||
# not ALSA
|
||||
return None
|
||||
if dev.startswith("CARD="):
|
||||
dev = "plughw:" + dev
|
||||
|
Loading…
x
Reference in New Issue
Block a user