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: