Fix items getting deleted on subsequent sync
This commit is contained in:
parent
056463da55
commit
7fce226d47
1 changed files with 24 additions and 22 deletions
|
@ -105,6 +105,7 @@ class FullSync(common.libsync_mixin):
|
|||
section['section_id'],
|
||||
section['plex_type'])
|
||||
self.queue.put(queue_info)
|
||||
with PlexDB() as self.plexdb:
|
||||
for xml_item in iterator:
|
||||
if self.isCanceled():
|
||||
return False
|
||||
|
@ -128,8 +129,12 @@ class FullSync(common.libsync_mixin):
|
|||
section['section_id'],
|
||||
section['plex_type'])
|
||||
self.queue.put(queue_info)
|
||||
with PlexDB() as self.plexdb:
|
||||
if section['plex_type'] != v.PLEX_TYPE_ARTIST:
|
||||
self.process_playstate(iterator)
|
||||
# Delete movies that are not on Plex anymore
|
||||
self.process_delete()
|
||||
# Wait again till the processing thread is done
|
||||
self.queue.join()
|
||||
except RuntimeError:
|
||||
LOG.error('Could not process playstate for section %s', section)
|
||||
|
@ -183,7 +188,6 @@ class FullSync(common.libsync_mixin):
|
|||
kinds,
|
||||
iterator_queue)
|
||||
backgroundthread.BGThreader.addTask(task)
|
||||
with PlexDB() as self.plexdb:
|
||||
while True:
|
||||
section = iterator_queue.get()
|
||||
if section is None:
|
||||
|
@ -196,8 +200,6 @@ class FullSync(common.libsync_mixin):
|
|||
# Now do the heavy lifting
|
||||
if self.isCanceled() or not self.process_section(section):
|
||||
return False
|
||||
# Delete movies that are not on Plex anymore
|
||||
self.process_delete()
|
||||
iterator_queue.task_done()
|
||||
return True
|
||||
|
||||
|
|
Loading…
Reference in a new issue