From 2ceb0cd7a2c8dcc3009986190a614633b29e7365 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 25 Nov 2018 20:31:40 +0100 Subject: [PATCH] Fix sync error when only an item is deleted in section --- resources/lib/library_sync/full_sync.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/resources/lib/library_sync/full_sync.py b/resources/lib/library_sync/full_sync.py index 4d8a4400..4d9b52a3 100644 --- a/resources/lib/library_sync/full_sync.py +++ b/resources/lib/library_sync/full_sync.py @@ -38,6 +38,7 @@ class FullSync(common.libsync_mixin): self.plex_type = None self.section_type = None self.processing_thread = None + self.section_initiated = False self.install_sync_done = utils.settings('SyncInstallRunDone') == 'true' self.threader = backgroundthread.ThreaderManager( worker=backgroundthread.NonstoppingBackgroundWorker) @@ -99,6 +100,7 @@ class FullSync(common.libsync_mixin): app.SYNC.path_verified = False try: # Sync new, updated and deleted items + self.section_initiated = True iterator = PF.SectionItems(section['section_id'], plex_type=self.plex_type) # Tell the processing thread about this new section @@ -163,6 +165,7 @@ class FullSync(common.libsync_mixin): ]) with PlexDB() as self.plexdb: for kind in kinds: + self.section_initiated = False # Setup our variables self.plex_type = kind[0] self.section_type = kind[1] @@ -172,6 +175,14 @@ class FullSync(common.libsync_mixin): if self.isCanceled() or not self.process_kind(): return False # Delete movies that are not on Plex anymore + if not self.section_initiated: + # Need to make sure that we're telling about this section + queue_info = InitNewSection(self.context, + 0, + '', + '', + self.plex_type) + self.queue.put(queue_info) self.process_delete() return True