mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Merge pull request #194 from druscoe/bug_fixes
Dont modify a list as you are traversing it.
This commit is contained in:
commit
c25d06ac80
2 changed files with 5 additions and 8 deletions
|
@ -131,11 +131,10 @@ class Library(threading.Thread):
|
||||||
Start new "daemon threads" to process library updates.
|
Start new "daemon threads" to process library updates.
|
||||||
(actual daemon thread is not supported in Kodi)
|
(actual daemon thread is not supported in Kodi)
|
||||||
'''
|
'''
|
||||||
for threads in (self.download_threads, self.writer_threads['updated'],
|
self.download_threads = [thread for thread in self.download_threads if not thread.is_done]
|
||||||
self.writer_threads['userdata'], self.writer_threads['removed']):
|
self.writer_threads['updated'] = [thread for thread in self.writer_threads['updated'] if not thread.is_done]
|
||||||
for thread in threads:
|
self.writer_threads['userdata'] = [thread for thread in self.writer_threads['userdata'] if not thread.is_done]
|
||||||
if thread.is_done:
|
self.writer_threads['removed'] = [thread for thread in self.writer_threads['removed'] if not thread.is_done]
|
||||||
threads.remove(thread)
|
|
||||||
|
|
||||||
if not self.player.isPlayingVideo() or settings('syncDuringPlay.bool') or xbmc.getCondVisibility('VideoPlayer.Content(livetv)'):
|
if not self.player.isPlayingVideo() or settings('syncDuringPlay.bool') or xbmc.getCondVisibility('VideoPlayer.Content(livetv)'):
|
||||||
|
|
||||||
|
|
|
@ -147,9 +147,7 @@ class Artwork(object):
|
||||||
|
|
||||||
def add_worker(self):
|
def add_worker(self):
|
||||||
|
|
||||||
for thread in self.threads:
|
self.threads = [thread for thread in self.threads if not thread.is_done]
|
||||||
if thread.is_done:
|
|
||||||
self.threads.remove(thread)
|
|
||||||
|
|
||||||
if self.queue.qsize() and len(self.threads) < 2:
|
if self.queue.qsize() and len(self.threads) < 2:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue