From ebfe7898ca162abc9f4d1a99be4d58234f0f7a87 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 5 Feb 2021 17:38:17 +0100 Subject: [PATCH] scan only counts if it was completed --- oml/item/scan.py | 1 + oml/tasks.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/oml/item/scan.py b/oml/item/scan.py index 78c8fe6..e4a97a8 100644 --- a/oml/item/scan.py +++ b/oml/item/scan.py @@ -225,6 +225,7 @@ def run_scan(): missing = ids - library_items if 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): old_icons = os.path.join(old, 'Metadata', 'icons.db') diff --git a/oml/tasks.py b/oml/tasks.py index 9f40975..d506853 100644 --- a/oml/tasks.py +++ b/oml/tasks.py @@ -36,8 +36,7 @@ class Tasks(Thread): def run(self): self.load_tasks() - if time.mktime(time.gmtime()) - settings.server.get('last_scan', 0) > 24*60*60: - settings.server['last_scan'] = time.mktime(time.gmtime()) + if (time.mktime(time.gmtime()) - settings.server.get('last_scan', 0)) > 24*60*60: self.queue('scan') import item.scan