From 08285df00f083693d33e52b535a364e283d40fc0 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Wed, 5 Aug 2015 23:55:55 -0500 Subject: [PATCH] Revert "Quick follow up" This reverts commit 567da0114ee43e3d232748b407df64ef6d2d7840. --- resources/lib/Player.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/resources/lib/Player.py b/resources/lib/Player.py index 087af456..97111e96 100644 --- a/resources/lib/Player.py +++ b/resources/lib/Player.py @@ -177,20 +177,16 @@ class Player( xbmc.Player ): muted = result.get(u'result').get(u'muted') # Get current audio and subtitles track - 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"]} , "id": 1}' result = xbmc.executeJSONRPC(track_query) result = json.loads(result) indexAudio = result['result']['currentaudiostream']['index'] indexSubs = result['result']['currentsubtitle']['index'] - boolSubs = result['result']['subtitleenabled'] # Convert back into an Emby index audioTracks = len(xbmc.Player().getAvailableAudioStreams()) indexAudio = indexAudio + 1 - if boolSubs: - indexSubs = indexSubs + audioTracks + 1 - else: - indexSubs = "" + indexSubs = indexSubs + audioTracks + 1 postdata = { 'QueueableMediaTypes': "Video", @@ -290,12 +286,11 @@ class Player( xbmc.Player ): muted = result.get(u'result').get(u'muted') # Get the current audio track and subtitles - 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"]} , "id": 1}' result = xbmc.executeJSONRPC(track_query) result = json.loads(result) indexAudio = result['result']['currentaudiostream']['index'] indexSubs = result['result']['currentsubtitle']['index'] - boolSubs = result['result']['subtitleenabled'] seekTime = xbmc.Player().getTime() @@ -319,11 +314,8 @@ class Player( xbmc.Player ): if subtitleindex: postdata['SubtitleStreamIndex'] = subtitleindex else: - if boolSubs: - audioTracks = len(xbmc.Player().getAvailableAudioStreams()) - postdata['SubtitleStreamIndex'] = indexSubs + audioTracks + 1 - else: - postdata['SubtitleStreamIndex'] = "" + audioTracks = len(xbmc.Player().getAvailableAudioStreams()) + postdata['SubtitleStreamIndex'] = indexSubs + audioTracks + 1 # Post playback to server self.logMsg("Sending POST play started.", 1)