From 8a2622c3f8a5985c55cb0a0956599384851e7246 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 27 May 2018 11:36:54 +0200 Subject: [PATCH] Fix playback of last item not starting up --- resources/lib/kodimonitor.py | 4 ++-- resources/lib/state.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 0e8548ba..9b4b9942 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -405,7 +405,7 @@ class KodiMonitor(xbmc.Monitor): else: container_key = '/library/metadata/%s' % plex_id # Remember that this player has been active - state.ACTIVE_PLAYERS.append(playerid) + state.ACTIVE_PLAYERS.add(playerid) status.update(info) LOG.debug('Set the Plex container_key to: %s', container_key) status['container_key'] = container_key @@ -473,7 +473,7 @@ def _playback_cleanup(ended=False): # Reset the player's status state.PLAYER_STATES[playerid] = copy.deepcopy(state.PLAYSTATE) # As all playback has halted, reset the players that have been active - state.ACTIVE_PLAYERS = [] + state.ACTIVE_PLAYERS = set() LOG.debug('Finished PKC playback cleanup') diff --git a/resources/lib/state.py b/resources/lib/state.py index 60b15ede..031cd796 100644 --- a/resources/lib/state.py +++ b/resources/lib/state.py @@ -97,7 +97,7 @@ COMMAND_PIPELINE_QUEUE = None WEBSOCKET_QUEUE = None # Which Kodi player is/has been active? (either int 1, 2 or 3) -ACTIVE_PLAYERS = [] +ACTIVE_PLAYERS = set() # Failsafe for throwing an empty video back to Kodi's setResolvedUrl to set # up our own playlist from the very beginning PKC_CAUSED_STOP = False