Remove unreliable check for playback init

This commit is contained in:
tomkat83 2018-01-02 14:30:54 +01:00
parent ac3be93894
commit b84a833e0d
4 changed files with 1 additions and 12 deletions

View file

@ -65,7 +65,6 @@ def process_command(request_path, params, queue=None):
convert_alexa_to_companion(params) convert_alexa_to_companion(params)
LOG.debug('Received request_path: %s, params: %s', request_path, params) LOG.debug('Received request_path: %s, params: %s', request_path, params)
if request_path == 'player/playback/playMedia': if request_path == 'player/playback/playMedia':
state.PLAYBACK_INIT_DONE = False
# We need to tell service.py # We need to tell service.py
action = 'alexa' if params.get('deviceName') == 'Alexa' else 'playlist' action = 'alexa' if params.get('deviceName') == 'Alexa' else 'playlist'
queue.put({ queue.put({
@ -73,7 +72,6 @@ def process_command(request_path, params, queue=None):
'data': params 'data': params
}) })
elif request_path == 'player/playback/refreshPlayQueue': elif request_path == 'player/playback/refreshPlayQueue':
state.PLAYBACK_INIT_DONE = False
queue.put({ queue.put({
'action': 'refreshPlayQueue', 'action': 'refreshPlayQueue',
'data': params 'data': params
@ -96,13 +94,10 @@ def process_command(request_path, params, queue=None):
elif request_path == "player/playback/stepBack": elif request_path == "player/playback/stepBack":
js.smallbackward() js.smallbackward()
elif request_path == "player/playback/skipNext": elif request_path == "player/playback/skipNext":
state.PLAYBACK_INIT_DONE = False
js.skipnext() js.skipnext()
elif request_path == "player/playback/skipPrevious": elif request_path == "player/playback/skipPrevious":
state.PLAYBACK_INIT_DONE = False
js.skipprevious() js.skipprevious()
elif request_path == "player/playback/skipTo": elif request_path == "player/playback/skipTo":
state.PLAYBACK_INIT_DONE = False
skip_to(params) skip_to(params)
elif request_path == "player/navigation/moveUp": elif request_path == "player/navigation/moveUp":
js.input_up() js.input_up()

View file

@ -125,9 +125,7 @@ class KodiMonitor(Monitor):
LOG.debug("Method: %s Data: %s", method, data) LOG.debug("Method: %s Data: %s", method, data)
if method == "Player.OnPlay": if method == "Player.OnPlay":
state.PLAYBACK_INIT_DONE = False
self.PlayBackStart(data) self.PlayBackStart(data)
state.PLAYBACK_INIT_DONE = True
elif method == "Player.OnStop": elif method == "Player.OnStop":
# Should refresh our video nodes, e.g. on deck # Should refresh our video nodes, e.g. on deck
# xbmc.executebuiltin('ReloadSkin()') # xbmc.executebuiltin('ReloadSkin()')

View file

@ -328,7 +328,7 @@ class SubscriptionMgr(object):
for player in players.values(): for player in players.values():
update_player_info(player['playerid']) update_player_info(player['playerid'])
self._notify_server(players) self._notify_server(players)
if self.subscribers and state.PLAYBACK_INIT_DONE is True: if self.subscribers:
msg = self.msg(players) msg = self.msg(players)
if self.isplaying is True: if self.isplaying is True:
# If we don't check here, Plex Companion devices will simply # If we don't check here, Plex Companion devices will simply

View file

@ -117,10 +117,6 @@ PLAYER_STATES = {
# paths for playback (since we're not receiving a Kodi id) # paths for playback (since we're not receiving a Kodi id)
PLEX_IDS = {} PLEX_IDS = {}
PLAYED_INFO = {} PLAYED_INFO = {}
# Set to False after having received a Companion command to play something
# Set to True after Kodi monitor PlayBackStart is done
# This will prohibit "old" Plex Companion messages being sent
PLAYBACK_INIT_DONE = True
# Kodi webserver details # Kodi webserver details
WEBSERVER_PORT = 8080 WEBSERVER_PORT = 8080