Don't update library items on shutdown

This commit is contained in:
Ruud
2013-08-14 12:31:41 +02:00
parent 67bc3903d4
commit d759280c18
2 changed files with 5 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ import traceback
log = CPLog(__name__)
class LibraryPlugin(Plugin):
default_dict = {'titles': {}, 'files':{}}
@@ -57,6 +58,9 @@ class LibraryPlugin(Plugin):
def update(self, identifier, default_title = '', force = False):
if self.shuttingDown():
return
db = get_session()
library = db.query(Library).filter_by(identifier = identifier).first()
done_status = fireEvent('status.get', 'done', single = True)

View File

@@ -192,7 +192,7 @@ class Manage(Plugin):
# Notify frontend
def afterUpdate():
if not self.in_progress:
if not self.in_progress or self.shuttingDown():
return
self.in_progress[folder]['to_go'] = self.in_progress[folder]['to_go'] - 1