From 7616d6dc26bd1909182525754459350cf016fc03 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 5 May 2019 11:14:27 +0200 Subject: [PATCH] Fixup --- resources/lib/webservice.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/resources/lib/webservice.py b/resources/lib/webservice.py index 8eb7d21f..ff3b2893 100644 --- a/resources/lib/webservice.py +++ b/resources/lib/webservice.py @@ -223,12 +223,8 @@ class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): return path = 'plugin://plugin.video.plexkodiconnect?mode=playstrm&plex_id=%s' % params['plex_id'] - xbmc.log('PLEX.webservice: sending %s' % path, xbmc.LOGDEBUG) self.wfile.write(bytes(path.encode('utf-8'))) if params['plex_id'] not in self.server.pending: - xbmc.log('PLEX.webservice: path %s params %s' % (self.path, params), - xbmc.LOGDEBUG) - self.server.pending.append(params['plex_id']) self.server.queue.put(params) if not len(self.server.threads): @@ -367,7 +363,9 @@ class QueuePlay(backgroundthread.KillableThread): while True: try: try: - params = self.server.queue.get(block=False) + # We cannot know when Kodi will send the last item, e.g. + # when playing an entire folder + params = self.server.queue.get(timeout=0.01) except Queue.Empty: LOG.debug('Wrapping up') if xbmc.getCondVisibility('VideoPlayer.Content(livetv)'): @@ -435,8 +433,8 @@ class QueuePlay(backgroundthread.KillableThread): # "task_done() called too many times" pass if abort: - playqueue.clear() xbmc.Player().stop() + playqueue.clear() self.server.queue.queue.clear() if play_folder: xbmc.executebuiltin('Dialog.Close(busydialognocancel)')