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