diff --git a/empty_video.mp4 b/empty_video.mp4 deleted file mode 100644 index 299de0ff..00000000 Binary files a/empty_video.mp4 and /dev/null differ diff --git a/resources/lib/app/playstate.py b/resources/lib/app/playstate.py index 4c104cac..c99aeafa 100644 --- a/resources/lib/app/playstate.py +++ b/resources/lib/app/playstate.py @@ -62,10 +62,3 @@ class PlayState(object): self.force_transcode = False # Which Kodi player is/has been active? (either int 1, 2 or 3) self.active_players = set() - - # Failsafe for throwing an empty video back to Kodi's setResolvedUrl to set - # up our own playlist from the very beginning - self.pkc_caused_stop = False - # Flag if the 0 length PKC video has already failed so we can start resolving - # playback (set in player.py) - self.pkc_caused_stop_done = True diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 79327a45..8fc2fd37 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -82,16 +82,11 @@ class KodiMonitor(xbmc.Monitor): with app.APP.lock_playqueues: self._hack_addon_paths_replay_video() elif data.get('end'): - if app.PLAYSTATE.pkc_caused_stop is True: - app.PLAYSTATE.pkc_caused_stop = False - LOG.debug('PKC caused this playback stop - ignoring') - else: - with app.APP.lock_playqueues: - _playback_cleanup(ended=True) + with app.APP.lock_playqueues: + _playback_cleanup(ended=True) else: with app.APP.lock_playqueues: _playback_cleanup() - app.PLAYSTATE.pkc_caused_stop_done = True app.SYNC.suspend_sync = False elif method == 'Playlist.OnAdd': with app.APP.lock_playqueues: diff --git a/resources/lib/playback.py b/resources/lib/playback.py index 30376793..79e6d52d 100644 --- a/resources/lib/playback.py +++ b/resources/lib/playback.py @@ -204,14 +204,6 @@ def _playback_init(plex_id, plex_type, playqueue, pos): else: trailers = True LOG.debug('Playing trailers: %s', trailers) - if RESOLVE: - # Sleep a bit to let setResolvedUrl do its thing - bit ugly - sleep_timer = 0 - while not app.PLAYSTATE.pkc_caused_stop_done: - app.APP.monitor.waitForAbort(0.05) - sleep_timer += 1 - if sleep_timer > 100: - break playqueue.clear() if plex_type != v.PLEX_TYPE_CLIP: # Post to the PMS to create a playqueue - in any case due to Companion @@ -268,14 +260,8 @@ def _ensure_resolve(abort=False): will be destroyed. """ if RESOLVE: - LOG.debug('Passing dummy path to Kodi') - # if not state.CONTEXT_MENU_PLAY: - # Because playback won't start with context menu play - app.PLAYSTATE.pkc_caused_stop = True - app.PLAYSTATE.pkc_caused_stop_done = False if not abort: result = pickler.Playback_Successful() - result.listitem = PKCListItem(path=v.NULL_VIDEO) pickler.pickle_me(result) else: # Shows PKC error message diff --git a/resources/lib/variables.py b/resources/lib/variables.py index 241fdfa9..f7cd3aba 100644 --- a/resources/lib/variables.py +++ b/resources/lib/variables.py @@ -120,12 +120,6 @@ EXTERNAL_SUBTITLE_TEMP_PATH = try_decode(xbmc.translatePath( # Multiply Plex time by this factor to receive Kodi time PLEX_TO_KODI_TIMEFACTOR = 1.0 / 1000.0 -# We're "failing" playback with a video of 0 length -NULL_VIDEO = os.path.join(ADDON_FOLDER, - 'addons', - ADDON_ID, - 'empty_video.mp4') - # Playlist stuff PLAYLIST_PATH = os.path.join(KODI_PROFILE, 'playlists') PLAYLIST_PATH_MIXED = os.path.join(PLAYLIST_PATH, 'mixed')