From 705a4f686e352cd4a293133ec4d469f8ecb0858c Mon Sep 17 00:00:00 2001 From: MoojMidge <56883549+MoojMidge@users.noreply.github.com> Date: Sun, 25 Feb 2024 11:30:34 +1100 Subject: [PATCH] Fix Python2 var-positional arguments SyntaxError --- .../lib/youtube_plugin/kodion/sql_store/function_cache.py | 5 +++-- resources/lib/youtube_plugin/kodion/utils/methods.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/lib/youtube_plugin/kodion/sql_store/function_cache.py b/resources/lib/youtube_plugin/kodion/sql_store/function_cache.py index 015ed30a2..19850a727 100644 --- a/resources/lib/youtube_plugin/kodion/sql_store/function_cache.py +++ b/resources/lib/youtube_plugin/kodion/sql_store/function_cache.py @@ -68,7 +68,7 @@ def get_result(self, func, *args, **kwargs): cache_id = self._create_id_from_func(partial_func) return self._get(cache_id) - def run(self, func, seconds, *args, _refresh=False, **kwargs): + def run(self, func, seconds, *args, **kwargs): """ Returns the cached data of the given function. :param func, function to cache @@ -76,6 +76,7 @@ def run(self, func, seconds, *args, _refresh=False, **kwargs): :param _refresh: bool, updates cache with new func result :return: """ + refresh = kwargs.pop('_refresh', False) partial_func = partial(func, *args, **kwargs) # if caching is disabled call the function @@ -83,7 +84,7 @@ def run(self, func, seconds, *args, _refresh=False, **kwargs): return partial_func() cache_id = self._create_id_from_func(partial_func) - data = None if _refresh else self._get(cache_id, seconds=seconds) + data = None if refresh else self._get(cache_id, seconds=seconds) if data is None: data = partial_func() self._set(cache_id, data) diff --git a/resources/lib/youtube_plugin/kodion/utils/methods.py b/resources/lib/youtube_plugin/kodion/utils/methods.py index 2466cdf6f..c980a575c 100644 --- a/resources/lib/youtube_plugin/kodion/utils/methods.py +++ b/resources/lib/youtube_plugin/kodion/utils/methods.py @@ -165,7 +165,7 @@ def _find_best_fit_video(_stream_data): return selected_stream_data -def create_path(*args, is_uri=False): +def create_path(*args, **kwargs): path = '/'.join([ part for part in [ @@ -178,7 +178,7 @@ def create_path(*args, is_uri=False): else: return '/' - if is_uri: + if kwargs.get('is_uri', False): return quote(path) return path