From 554e65cbd39d31b6f8b601bf7f90587a84173e8e Mon Sep 17 00:00:00 2001 From: j Date: Sun, 13 Jan 2019 10:21:04 +0530 Subject: [PATCH] fix file check --- oml/item/scan.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/oml/item/scan.py b/oml/item/scan.py index 7cc90f4..d9c4bb1 100644 --- a/oml/item/scan.py +++ b/oml/item/scan.py @@ -197,8 +197,9 @@ def run_scan(): logger.debug('cleaning up %s deleted records', len(gone)) for id in gone: i = Item.get(id) - if not i.file or not os.path.exists(i.file.fullpath()): - logger.debug('cleaning orphaned record %s %s', i, i.file.fullpath() if i.file else '') + path = i.get_path() + if path and not os.path.exists(path): + logger.debug('cleaning orphaned record %s %s', i, path) i.remove_file() missing = ids - library_items if missing: