fix file check
This commit is contained in:
parent
ca29c73043
commit
554e65cbd3
1 changed files with 3 additions and 2 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue