Prevent error message upon DB reset

This commit is contained in:
croneter 2018-11-05 18:31:26 +01:00
parent 0fa8fe1144
commit bc1ad1d998
3 changed files with 5 additions and 2 deletions

View file

@ -8,7 +8,7 @@ from .. import state
class libsync_mixin(object): class libsync_mixin(object):
def isCanceled(self): 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) state.SUSPEND_LIBRARY_THREAD or state.SUSPEND_SYNC)

View file

@ -30,7 +30,7 @@ class FanartThread(backgroundthread.KillableThread):
return state.STOP_PKC return state.STOP_PKC
def isSuspended(self): def isSuspended(self):
return state.SUSPEND_LIBRARY_THREAD return state.SUSPEND_LIBRARY_THREAD or state.STOP_SYNC
def run(self): def run(self):
try: try:
@ -65,6 +65,8 @@ class FanartTask(backgroundthread.Task, common.libsync_mixin):
self.refresh = refresh self.refresh = refresh
def run(self): def run(self):
if self.isCanceled():
return
process_fanart(self.plex_id, self.plex_type, self.refresh) process_fanart(self.plex_id, self.plex_type, self.refresh)

View file

@ -526,6 +526,7 @@ def wipe_database():
for entry in plexdb.cursor: for entry in plexdb.cursor:
playlist_paths.append(entry[0]) playlist_paths.append(entry[0])
plex_db.wipe() plex_db.wipe()
plex_db.initialize()
# Delete all synced playlists # Delete all synced playlists
for path in playlist_paths: for path in playlist_paths:
try: try: