From 2f8970aa6662e566c32349ff498b52fe0e2743a4 Mon Sep 17 00:00:00 2001 From: newt-sc <47229722+newt-sc@users.noreply.github.com> Date: Tue, 28 Apr 2020 00:03:41 +0300 Subject: [PATCH] release: v0.0.17 --- CHANGELOG.md | 5 +++++ a4kSubtitles/search.py | 14 +++++++++++--- addon.xml | 9 +++++++-- packages/addons.xml | 9 +++++++-- packages/addons.xml.crc | 2 +- 5 files changed, 31 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef8664b..e62399c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +* [v0.0.17](https://github.com/newt-sc/a4kSubtitles/releases/tag/service.subtitles.a4ksubtitles%2Fservice.subtitles.a4ksubtitles-0.0.17): + * Reuse KODI's Python language invoker + * Improves performance on low-end devices when switching subtitles for best match + * Url decode subtitle names + * [v0.0.16](https://github.com/newt-sc/a4kSubtitles/releases/tag/service.subtitles.a4ksubtitles%2Fservice.subtitles.a4ksubtitles-0.0.16): * Cache last result * OpenSubtitles always queries: diff --git a/a4kSubtitles/search.py b/a4kSubtitles/search.py index ab2ce99..90241bc 100644 --- a/a4kSubtitles/search.py +++ b/a4kSubtitles/search.py @@ -72,6 +72,8 @@ def __sanitize_results(core, meta, results): result['name'] = '%s%s' % (meta.filename_without_ext, ext) except: pass + result['name'] = core.utils.unquote(result['name']) + return list(temp_dict.values()) def __apply_language_filter(meta, results): @@ -131,6 +133,11 @@ def __wait_threads(core, request_threads): core.utils.wait_threads(threads) +def __complete_search(core, results): + if core.api_mode_enabled: + return results + __add_results(core, results) + def __search(core, service_name, meta, results): service = core.services[service_name] requests = service.build_search_requests(core, service_name, meta) @@ -177,6 +184,9 @@ def search(core, params): threads.append((auth_thread, search_thread)) + if len(threads) == 0: + return __complete_search(core, last_query_results) + __wait_threads(core, threads) results = __apply_language_filter(meta, results) results = __sanitize_results(core, meta, results) @@ -196,6 +206,4 @@ def search(core, params): results = sorted(results, key=sorter) __save_results(core, meta, results) - if core.api_mode_enabled: - return results - __add_results(core, results) + return __complete_search(core, results) diff --git a/addon.xml b/addon.xml index 3ca8b31..71dc452 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ @@ -16,7 +16,7 @@ Multi-source subtitles addon optimized for Seren. Supports: OpenSubtitles, BSPlayer all - false + true MIT License https://github.com/newt-sc/a4kSubtitles https://github.com/newt-sc/a4kSubtitles @@ -24,6 +24,11 @@ Supports: OpenSubtitles, BSPlayer icon.png +[v0.0.17]: + * Reuse KODI's Python language invoker + * Improves performance on low-end devices when switching subtitles for best match + * Url decode subtitle names + [v0.0.16]: * Cache last result * OpenSubtitles always queries: diff --git a/packages/addons.xml b/packages/addons.xml index 17de3e5..1d50c93 100644 --- a/packages/addons.xml +++ b/packages/addons.xml @@ -4,7 +4,7 @@ @@ -19,7 +19,7 @@ Multi-source subtitles addon optimized for Seren. Supports: OpenSubtitles, BSPlayer all - false + true MIT License https://github.com/newt-sc/a4kSubtitles https://github.com/newt-sc/a4kSubtitles @@ -27,6 +27,11 @@ Supports: OpenSubtitles, BSPlayer icon.png +[v0.0.17]: + * Reuse KODI's Python language invoker + * Improves performance on low-end devices when switching subtitles for best match + * Url decode subtitle names + [v0.0.16]: * Cache last result * OpenSubtitles always queries: diff --git a/packages/addons.xml.crc b/packages/addons.xml.crc index 77c608b..32c8cbe 100644 --- a/packages/addons.xml.crc +++ b/packages/addons.xml.crc @@ -1 +1 @@ -1c35d9a401af705d8c83a6b6d89d57d22064ef47 \ No newline at end of file +e96e986d49f0f117aa3da261e8ea93e0f8f4a389 \ No newline at end of file