From cc587ed714ee515e3ca11b785ac046e0579f7c49 Mon Sep 17 00:00:00 2001 From: croneter Date: Sat, 19 Dec 2020 21:07:50 +0100 Subject: [PATCH] Make seek more resilient. Kodi bug still: JSONRPC error Received value does not match any of the union type definitions --- resources/lib/playback.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/lib/playback.py b/resources/lib/playback.py index 75977538..6a7e61ef 100644 --- a/resources/lib/playback.py +++ b/resources/lib/playback.py @@ -20,7 +20,7 @@ from . import playback_decision, app LOG = getLogger('PLEX.playback') # Do we need to return ultimately with a setResolvedUrl? RESOLVE = True -TRY_TO_SEEK_FOR = 300 # =30 seconds +TRY_TO_SEEK_FOR = 10 # =30 seconds IGNORE_SECONDS_AT_START = 15 ############################################################################### @@ -599,8 +599,8 @@ def threaded_playback(kodi_playlist, startpos, offset): # RuntimeError: XBMC is not playing any media file pass i = 0 - answ = js.seek_to(offset * 1000) - while 'error' in answ: + answ = None + while answ is None or (answ and 'error' in answ): # Kodi sometimes returns {u'message': u'Failed to execute method.', # u'code': -32100} if user quickly switches videos if app.APP.monitor.waitForAbort(0.1):