fix file check

This commit is contained in:
j 2019-01-13 10:21:04 +05:30
parent ca29c73043
commit 554e65cbd3

View file

@ -197,8 +197,9 @@ def run_scan():
logger.debug('cleaning up %s deleted records', len(gone)) logger.debug('cleaning up %s deleted records', len(gone))
for id in gone: for id in gone:
i = Item.get(id) i = Item.get(id)
if not i.file or not os.path.exists(i.file.fullpath()): path = i.get_path()
logger.debug('cleaning orphaned record %s %s', i, i.file.fullpath() if i.file else '') if path and not os.path.exists(path):
logger.debug('cleaning orphaned record %s %s', i, path)
i.remove_file() i.remove_file()
missing = ids - library_items missing = ids - library_items
if missing: if missing: