mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 02:06:09 +00:00
Fix error caused when starting from widget
.get to avoid key error. Didn't think about the playback error from widgets.
This commit is contained in:
parent
cdfeeaf4fb
commit
e7335b05a0
1 changed files with 4 additions and 4 deletions
|
@ -198,8 +198,8 @@ class Player( xbmc.Player ):
|
||||||
track_query = '{"jsonrpc": "2.0", "method": "Player.GetProperties", "params": {"playerid":1,"properties": ["currentsubtitle","currentaudiostream","subtitleenabled"]} , "id": 1}'
|
track_query = '{"jsonrpc": "2.0", "method": "Player.GetProperties", "params": {"playerid":1,"properties": ["currentsubtitle","currentaudiostream","subtitleenabled"]} , "id": 1}'
|
||||||
result = xbmc.executeJSONRPC(track_query)
|
result = xbmc.executeJSONRPC(track_query)
|
||||||
result = json.loads(result)
|
result = json.loads(result)
|
||||||
indexAudio = result['result']['currentaudiostream']['index']
|
indexAudio = result['result']['currentaudiostream'].get('index', "")
|
||||||
indexSubs = result['result']['currentsubtitle']['index']
|
indexSubs = result['result']['currentsubtitle'].get('index', "")
|
||||||
subsEnabled = result['result']['subtitleenabled']
|
subsEnabled = result['result']['subtitleenabled']
|
||||||
|
|
||||||
# Convert back into an Emby index
|
# Convert back into an Emby index
|
||||||
|
@ -320,8 +320,8 @@ class Player( xbmc.Player ):
|
||||||
track_query = '{"jsonrpc": "2.0", "method": "Player.GetProperties", "params": {"playerid": 1,"properties": ["currentsubtitle","currentaudiostream","subtitleenabled"]} , "id": 1}'
|
track_query = '{"jsonrpc": "2.0", "method": "Player.GetProperties", "params": {"playerid": 1,"properties": ["currentsubtitle","currentaudiostream","subtitleenabled"]} , "id": 1}'
|
||||||
result = xbmc.executeJSONRPC(track_query)
|
result = xbmc.executeJSONRPC(track_query)
|
||||||
result = json.loads(result)
|
result = json.loads(result)
|
||||||
indexAudio = result['result']['currentaudiostream']['index']
|
indexAudio = result['result']['currentaudiostream'].get('index', "")
|
||||||
indexSubs = result['result']['currentsubtitle']['index']
|
indexSubs = result['result']['currentsubtitle'].get('index', "")
|
||||||
subsEnabled = result['result']['subtitleenabled']
|
subsEnabled = result['result']['subtitleenabled']
|
||||||
|
|
||||||
postdata['AudioStreamIndex'] = indexAudio + 1
|
postdata['AudioStreamIndex'] = indexAudio + 1
|
||||||
|
|
Loading…
Reference in a new issue