Update all Kodi player properties for Companion update

This commit is contained in:
croneter 2017-12-14 15:20:41 +01:00
parent b520fe2b79
commit 502c013af0
2 changed files with 1 additions and 24 deletions

View file

@ -407,19 +407,6 @@ def get_player_props(playerid):
'currentsubtitle']})['result'] 'currentsubtitle']})['result']
def current_state(playerid):
"""
Returns a dict for the active Kodi player with the following values:
(values that change from second to second with no monitoring possible)
{
'time' The current item's time in Kodi time
}
"""
return jsonrpc('Player.GetProperties').execute({
'playerid': playerid,
'properties': ['time']})['result']
def current_audiostream(playerid): def current_audiostream(playerid):
""" """
Returns a dict of the active audiostream for playerid [int]: Returns a dict of the active audiostream for playerid [int]:

View file

@ -115,16 +115,6 @@ class SubscriptionMgr(object):
state.PLAYER_STATES[playerid]['plex_id'] state.PLAYER_STATES[playerid]['plex_id']
return key return key
def _set_current_details(self, playerid):
"""
Sets the current details for the player with playerid in state.py:
PLAYER_STATES[playerid]{
'time'
}
"""
state.PLAYER_STATES[playerid].update(js.current_state(playerid))
def _kodi_stream_index(self, playerid, stream_type): def _kodi_stream_index(self, playerid, stream_type):
""" """
Returns the current Kodi stream index [int] for the player playerid Returns the current Kodi stream index [int] for the player playerid
@ -141,7 +131,7 @@ class SubscriptionMgr(object):
return ' <Timeline state="stopped" controllable="%s" type="%s" ' \ return ' <Timeline state="stopped" controllable="%s" type="%s" ' \
'itemType="%s" />\n' % (CONTROLLABLE[ptype], ptype, ptype) 'itemType="%s" />\n' % (CONTROLLABLE[ptype], ptype, ptype)
playerid = player['playerid'] playerid = player['playerid']
self._set_current_details(playerid) state.PLAYER_STATES[playerid].update(js.get_player_props(playerid))
info = state.PLAYER_STATES[playerid] info = state.PLAYER_STATES[playerid]
status = 'paused' if info['speed'] == '0' else 'playing' status = 'paused' if info['speed'] == '0' else 'playing'
ret = ' <Timeline state="%s"' % status ret = ' <Timeline state="%s"' % status