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

View File

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

View File

@ -328,7 +328,7 @@ class SubscriptionMgr(object):
for player in players.values():
update_player_info(player['playerid'])
self._notify_server(players)
if self.subscribers and state.PLAYBACK_INIT_DONE is True:
if self.subscribers:
msg = self.msg(players)
if self.isplaying is True:
# 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)
PLEX_IDS = {}
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
WEBSERVER_PORT = 8080