From 8d3f367a362ca78f74b071f10d7096c8b1b6e945 Mon Sep 17 00:00:00 2001 From: MoojMidge <56883549+MoojMidge@users.noreply.github.com> Date: Fri, 8 Nov 2024 00:08:00 +1100 Subject: [PATCH] Use redirect in multiple busy dialog crash workaround #938 --- .../youtube_plugin/kodion/context/abstract_context.py | 4 +++- .../lib/youtube_plugin/kodion/plugin/xbmc/xbmc_plugin.py | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/resources/lib/youtube_plugin/kodion/context/abstract_context.py b/resources/lib/youtube_plugin/kodion/context/abstract_context.py index ba3ac74bd..b34a178a1 100644 --- a/resources/lib/youtube_plugin/kodion/context/abstract_context.py +++ b/resources/lib/youtube_plugin/kodion/context/abstract_context.py @@ -265,7 +265,9 @@ def create_uri(self, path=None, params=None, run=False): uri = self._plugin_id.join(('plugin://', uri)) if params: - uri = '?'.join((uri, urlencode(params))) + if isinstance(params, (dict, list, tuple)): + params = urlencode(params) + uri = '?'.join((uri, params)) return ''.join(( 'RunPlugin(', diff --git a/resources/lib/youtube_plugin/kodion/plugin/xbmc/xbmc_plugin.py b/resources/lib/youtube_plugin/kodion/plugin/xbmc/xbmc_plugin.py index ecf663906..c041f8a78 100644 --- a/resources/lib/youtube_plugin/kodion/plugin/xbmc/xbmc_plugin.py +++ b/resources/lib/youtube_plugin/kodion/plugin/xbmc/xbmc_plugin.py @@ -13,7 +13,7 @@ from traceback import format_stack from ..abstract_plugin import AbstractPlugin -from ...compatibility import xbmcplugin +from ...compatibility import urlsplit, xbmcplugin from ...constants import ( BUSY_FLAG, CONTAINER_FOCUS, @@ -312,7 +312,12 @@ def uri_action(context, uri): elif context.is_plugin_path(uri): context.log_debug('Redirecting to: |{0}|'.format(uri)) - action = 'RunPlugin({0})'.format(uri) + uri = urlsplit(uri) + action = context.create_uri( + (PATHS.ROUTE, uri.path), + uri.query, + run=True, + ) result = False else: