From 6e6e753475c71dadf6353037fcfbfc3d66686ff9 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 5 Dec 2021 17:48:13 -0500 Subject: [PATCH 1/2] Remove unneeded double_urlencode function --- resources/lib/cache_images.py | 5 ++--- resources/lib/utils.py | 6 ------ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/resources/lib/cache_images.py b/resources/lib/cache_images.py index 13a5f93..e8d092f 100644 --- a/resources/lib/cache_images.py +++ b/resources/lib/cache_images.py @@ -19,7 +19,7 @@ from .loghandler import LazyLogger from .jsonrpc import JsonRpc, get_value from .translation import string_load from .datamanager import DataManager -from .utils import get_art, double_urlencode +from .utils import get_art from .kodi_utils import HomeWindow downloadUtils = DownloadUtils() @@ -326,8 +326,7 @@ class CacheArtwork(threading.Thread): count_done = 0 for index, get_url in enumerate(missing_texture_urls, 1): - url = double_urlencode(get_url) - kodi_texture_url = ("/image/image://%s" % url) + kodi_texture_url = ("/image/image://%s" % get_url) log.debug("kodi_texture_url: {0}".format(kodi_texture_url)) percentage = int((float(index) / float(total)) * 100) diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 4df8627..2ab6047 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -284,12 +284,6 @@ def id_generator(size=6, chars=string.ascii_uppercase + string.digits): return ''.join(random.choice(chars) for _ in range(size)) -def double_urlencode(text): - text = single_urlencode(text) - text = single_urlencode(text) - return text - - def single_urlencode(text): # urlencode needs a utf- string text = urlencode({'blahblahblah': text.encode('utf-8')}) From b6dd0285a8bca92879aa69db20c0776343886b70 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 5 Dec 2021 22:22:09 -0500 Subject: [PATCH 2/2] Update string format method --- resources/lib/cache_images.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lib/cache_images.py b/resources/lib/cache_images.py index e8d092f..0dc507e 100644 --- a/resources/lib/cache_images.py +++ b/resources/lib/cache_images.py @@ -326,7 +326,7 @@ class CacheArtwork(threading.Thread): count_done = 0 for index, get_url in enumerate(missing_texture_urls, 1): - kodi_texture_url = ("/image/image://%s" % get_url) + kodi_texture_url = "/image/image://{0}".format(get_url) log.debug("kodi_texture_url: {0}".format(kodi_texture_url)) percentage = int((float(index) / float(total)) * 100)