Merge pull request #884 from croneter/fix-runtimeerror

Fix playback startup and RuntimeError: Unknown exception thrown from the call "XBMCAddon::xbmcplugin::setResolvedUrl"
This commit is contained in:
croneter 2019-06-12 20:05:16 +02:00 committed by GitHub
commit 7018aba655
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,6 @@ import xbmc
import xbmcgui import xbmcgui
LOG = getLogger('PLEX.transfer') LOG = getLogger('PLEX.transfer')
MONITOR = xbmc.Monitor()
WINDOW = xbmcgui.Window(10000) WINDOW = xbmcgui.Window(10000)
WINDOW_UPSTREAM = 'plexkodiconnect.result.upstream'.encode('utf-8') WINDOW_UPSTREAM = 'plexkodiconnect.result.upstream'.encode('utf-8')
WINDOW_DOWNSTREAM = 'plexkodiconnect.result.downstream'.encode('utf-8') WINDOW_DOWNSTREAM = 'plexkodiconnect.result.downstream'.encode('utf-8')
@ -67,8 +66,7 @@ def plex_command(value):
safe - let's hope the Kodi user can't click fast enough safe - let's hope the Kodi user can't click fast enough
""" """
while kodi_window(WINDOW_COMMAND): while kodi_window(WINDOW_COMMAND):
if MONITOR.waitForAbort(20): xbmc.sleep(50)
return
kodi_window(WINDOW_COMMAND, value=value) kodi_window(WINDOW_COMMAND, value=value)
@ -114,6 +112,7 @@ def wait_for_transfer(source='main'):
Set source='default' if you wait for data FROM another Python default.py Set source='default' if you wait for data FROM another Python default.py
instance, 'main' if your default.py needs to wait for the main thread instance, 'main' if your default.py needs to wait for the main thread
""" """
LOG.debug('Waiting for transfer from %s', source)
window = WINDOW_DOWNSTREAM if source == 'main' else WINDOW_UPSTREAM window = WINDOW_DOWNSTREAM if source == 'main' else WINDOW_UPSTREAM
result = '' result = ''
while not result: while not result:
@ -123,8 +122,7 @@ def wait_for_transfer(source='main'):
LOG.debug('Received') LOG.debug('Received')
result = json.loads(result) result = json.loads(result)
return de_serialize(result) return de_serialize(result)
elif MONITOR.waitForAbort(0.05): xbmc.sleep(50)
return
def convert_pkc_to_listitem(pkc_listitem): def convert_pkc_to_listitem(pkc_listitem):