diff --git a/resources/lib/playback.py b/resources/lib/playback.py index da9d8b9a..68f223dd 100644 --- a/resources/lib/playback.py +++ b/resources/lib/playback.py @@ -68,6 +68,7 @@ def playback_triage(plex_id=None, plex_type=None, path=None, resolve=True): except IndexError: # Release our default.py before starting our own Kodi player instance if resolve is True: + state.PKC_CAUSED_STOP = True result = Playback_Successful() result.listitem = PKC_ListItem(path='PKC_Dummy_Path_Which_Fails') pickle_me(result) diff --git a/resources/lib/player.py b/resources/lib/player.py index 29d4b660..64710f66 100644 --- a/resources/lib/player.py +++ b/resources/lib/player.py @@ -82,7 +82,11 @@ class PKC_Player(Player): Will be called when playback is stopped by the user """ LOG.debug("ONPLAYBACK_STOPPED") - playback_cleanup() + if state.PKC_CAUSED_STOP is True: + state.PKC_CAUSED_STOP = False + LOG.debug('PKC caused this playback stop - ignoring') + else: + playback_cleanup() def onPlayBackEnded(self): """ diff --git a/resources/lib/state.py b/resources/lib/state.py index 9e371232..0f7b20f4 100644 --- a/resources/lib/state.py +++ b/resources/lib/state.py @@ -88,6 +88,8 @@ WEBSOCKET_QUEUE = None # Which Kodi player is/has been active? (either int 1, 2 or 3) ACTIVE_PLAYERS = [] +# Failsafe for throwing failing ListItems() back to Kodi's setResolvedUrl +PKC_CAUSED_STOP = False # Kodi player states - here, initial values are set PLAYER_STATES = {