diff --git a/jellyfin_kodi/library.py b/jellyfin_kodi/library.py index 180ece7d..0315c25a 100644 --- a/jellyfin_kodi/library.py +++ b/jellyfin_kodi/library.py @@ -131,11 +131,10 @@ class Library(threading.Thread): Start new "daemon threads" to process library updates. (actual daemon thread is not supported in Kodi) ''' - for threads in (self.download_threads, self.writer_threads['updated'], - self.writer_threads['userdata'], self.writer_threads['removed']): - for thread in threads: - if thread.is_done: - threads.remove(thread) + self.download_threads = [thread for thread in self.download_threads if not thread.is_done] + self.writer_threads['updated'] = [thread for thread in self.writer_threads['updated'] if not thread.is_done] + self.writer_threads['userdata'] = [thread for thread in self.writer_threads['userdata'] if not thread.is_done] + self.writer_threads['removed'] = [thread for thread in self.writer_threads['removed'] if not thread.is_done] if not self.player.isPlayingVideo() or settings('syncDuringPlay.bool') or xbmc.getCondVisibility('VideoPlayer.Content(livetv)'): diff --git a/jellyfin_kodi/objects/kodi/artwork.py b/jellyfin_kodi/objects/kodi/artwork.py index 0625d75e..b9fc4f93 100644 --- a/jellyfin_kodi/objects/kodi/artwork.py +++ b/jellyfin_kodi/objects/kodi/artwork.py @@ -147,9 +147,7 @@ class Artwork(object): def add_worker(self): - for thread in self.threads: - if thread.is_done: - self.threads.remove(thread) + self.threads = [thread for thread in self.threads if not thread.is_done] if self.queue.qsize() and len(self.threads) < 2: