From 121e8e02433540ffe7020d9ad6a539eb9167ffe7 Mon Sep 17 00:00:00 2001 From: croneter Date: Fri, 16 Feb 2018 17:25:17 +0100 Subject: [PATCH] Hack for repeatedly starting same video using Addon Paths --- resources/lib/kodimonitor.py | 1 + resources/lib/playqueue.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index daea2468..7cf72e64 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -217,6 +217,7 @@ class KodiMonitor(Monitor): # Hack we need for RESUMABLE items because Kodi lost the path of the # last played item that is now being replayed (see playback.py's # Player().play()) + # Also see playqueue.py _compare_playqueues() LOG.info('Detected re-start of playback of last item') old = state.OLD_PLAYER_STATES[data['playlistid']] kwargs = { diff --git a/resources/lib/playqueue.py b/resources/lib/playqueue.py index 8d5756c0..84cee9a0 100644 --- a/resources/lib/playqueue.py +++ b/resources/lib/playqueue.py @@ -195,6 +195,13 @@ class PlayqueueMonitor(Thread): except PL.PlaylistError: # Could not add the element pass + except IndexError: + # This is really a hack - happens when using Addon Paths + # and repeatedly starting the same element. Kodi will then + # not pass kodi id nor file path AND will also not + # start-up playback. Hence kodimonitor kicks off playback. + # Also see kodimonitor.py - _playlist_onadd() + pass else: for j in range(i, len(index)): index[j] += 1