diff --git a/jellyfin_kodi/library.py b/jellyfin_kodi/library.py index 43fc8fc1..5ca1bdd9 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, @@ -138,7 +138,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() @@ -224,6 +225,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: @@ -231,6 +233,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): 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 @@ - - + +