From 4649d2371f22445e4e267e843658b837219ffef2 Mon Sep 17 00:00:00 2001 From: Chuddah Date: Sun, 16 Feb 2020 23:39:27 +0000 Subject: [PATCH 1/3] Keep adding threads until the user limit has been reached --- jellyfin_kodi/library.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jellyfin_kodi/library.py b/jellyfin_kodi/library.py index 29d4ea99..4d341979 100644 --- a/jellyfin_kodi/library.py +++ b/jellyfin_kodi/library.py @@ -139,7 +139,8 @@ class Library(threading.Thread): if not self.player.isPlayingVideo() or settings('syncDuringPlay.bool') or xbmc.getCondVisibility('VideoPlayer.Content(livetv)'): - self.worker_downloads() + while self.worker_downloads(): + pass self.worker_sort() self.worker_updates() @@ -225,6 +226,7 @@ class Library(threading.Thread): ''' Get items from jellyfin and place them in the appropriate queues. ''' + added_threads = False for queue in ((self.updated_queue, self.updated_output), (self.userdata_queue, self.userdata_output)): if queue[0].qsize() and len(self.download_threads) < DTHREADS: @@ -232,6 +234,8 @@ class Library(threading.Thread): new_thread.start() LOG.info("-->[ q:download/%s ]", id(new_thread)) self.download_threads.append(new_thread) + added_threads = True + return added_threads def worker_sort(self): From 2bf2206a1ea050a67881c37886b90ee64d79f682 Mon Sep 17 00:00:00 2001 From: Chuddah Date: Mon, 17 Feb 2020 11:59:48 +0000 Subject: [PATCH 2/3] Move the responsibility of the maximum number of threads to the UI. Previously the user was able to set any number to limitThreads UI component but internally that was reduced to be a maximum of 50 which is deceiving to the user. Set this is set as a boundary in the UI. This also fixes a bug that the user could set the number of threads to zero which follows from GIGO; but let the UI assist by placing a min number of threads to 1. --- jellyfin_kodi/library.py | 2 +- resources/settings.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jellyfin_kodi/library.py b/jellyfin_kodi/library.py index 4d341979..8ff6b24a 100644 --- a/jellyfin_kodi/library.py +++ b/jellyfin_kodi/library.py @@ -23,7 +23,7 @@ from jellyfin import Jellyfin ################################################################################################## LOG = logging.getLogger("JELLYFIN." + __name__) -LIMIT = min(int(settings('limitIndex') or 50), 50) +LIMIT = int(settings('limitIndex') or 15) DTHREADS = int(settings('limitThreads') or 3) MEDIA = { 'Movie': Movies, diff --git a/resources/settings.xml b/resources/settings.xml index ae1ad0d1..661da59b 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -25,8 +25,8 @@ - - + + From 4974d823d4cb58482177fe3e0c507fe49fb65b70 Mon Sep 17 00:00:00 2001 From: Daniel De Jesus Date: Wed, 19 Feb 2020 02:25:24 +0000 Subject: [PATCH 3/3] Added translation using Weblate (Spanish (Dominican Republic)) --- resources/language/resource.language.es_DO/strings.po | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 resources/language/resource.language.es_DO/strings.po diff --git a/resources/language/resource.language.es_DO/strings.po b/resources/language/resource.language.es_DO/strings.po new file mode 100644 index 00000000..4f8f6e6d --- /dev/null +++ b/resources/language/resource.language.es_DO/strings.po @@ -0,0 +1,2 @@ +msgid "" +msgstr "X-Generator: Weblate\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit" \ No newline at end of file