scan only counts if it was completed

This commit is contained in:
j 2021-02-05 17:38:17 +01:00
parent 8766c7ef4e
commit ebfe7898ca
2 changed files with 2 additions and 2 deletions

View file

@ -225,6 +225,7 @@ def run_scan():
missing = ids - library_items missing = ids - library_items
if missing: if missing:
logger.debug('%s items in library without a record', len(missing)) logger.debug('%s items in library without a record', len(missing))
settings.server['last_scan'] = time.mktime(time.gmtime())
def change_path(old, new): def change_path(old, new):
old_icons = os.path.join(old, 'Metadata', 'icons.db') old_icons = os.path.join(old, 'Metadata', 'icons.db')

View file

@ -36,8 +36,7 @@ class Tasks(Thread):
def run(self): def run(self):
self.load_tasks() self.load_tasks()
if time.mktime(time.gmtime()) - settings.server.get('last_scan', 0) > 24*60*60: if (time.mktime(time.gmtime()) - settings.server.get('last_scan', 0)) > 24*60*60:
settings.server['last_scan'] = time.mktime(time.gmtime())
self.queue('scan') self.queue('scan')
import item.scan import item.scan