From bc1ad1d9988963875d9651f54d8ac4c3e45f8a2e Mon Sep 17 00:00:00 2001 From: croneter Date: Mon, 5 Nov 2018 18:31:26 +0100 Subject: [PATCH] Prevent error message upon DB reset --- resources/lib/library_sync/common.py | 2 +- resources/lib/library_sync/fanart.py | 4 +++- resources/lib/utils.py | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/lib/library_sync/common.py b/resources/lib/library_sync/common.py index bfee2808..07b35fec 100644 --- a/resources/lib/library_sync/common.py +++ b/resources/lib/library_sync/common.py @@ -8,7 +8,7 @@ from .. import state class libsync_mixin(object): def isCanceled(self): - return (self._canceled or state.STOP_PKC or + return (self._canceled or state.STOP_PKC or state.STOP_SYNC or state.SUSPEND_LIBRARY_THREAD or state.SUSPEND_SYNC) diff --git a/resources/lib/library_sync/fanart.py b/resources/lib/library_sync/fanart.py index 3f1582c1..10a0a70c 100644 --- a/resources/lib/library_sync/fanart.py +++ b/resources/lib/library_sync/fanart.py @@ -30,7 +30,7 @@ class FanartThread(backgroundthread.KillableThread): return state.STOP_PKC def isSuspended(self): - return state.SUSPEND_LIBRARY_THREAD + return state.SUSPEND_LIBRARY_THREAD or state.STOP_SYNC def run(self): try: @@ -65,6 +65,8 @@ class FanartTask(backgroundthread.Task, common.libsync_mixin): self.refresh = refresh def run(self): + if self.isCanceled(): + return process_fanart(self.plex_id, self.plex_type, self.refresh) diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 3f621f8c..b49b5505 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -526,6 +526,7 @@ def wipe_database(): for entry in plexdb.cursor: playlist_paths.append(entry[0]) plex_db.wipe() + plex_db.initialize() # Delete all synced playlists for path in playlist_paths: try: