Compare commits
No commits in common. "3d1a629970b1eea1ff46593ae287501b5b7be952" and "56df24baadfa1e6cbbb46dc64cf008255b1bfb4f" have entirely different histories.
3d1a629970
...
56df24baad
1 changed files with 1 additions and 15 deletions
|
|
@ -144,15 +144,6 @@ def run_scan():
|
|||
if os.path.exists(f):
|
||||
id = media.get_id(f)
|
||||
file = File.get(id)
|
||||
if file:
|
||||
f1 = file.fullpath()
|
||||
f2 = os.path.join(prefix, f)
|
||||
if f1 != f2 and os.path.exists(f1) and os.path.exists(f2):
|
||||
logger.debug('file exists in multiple locations %s', id)
|
||||
logger.debug('"%s" vs "%s"', f1, f2)
|
||||
os.chmod(f2, stat.S_IWRITE)
|
||||
os.unlink(f2)
|
||||
continue
|
||||
if id in ids:
|
||||
logger.debug('file exists in multiple locations %s', id)
|
||||
if file:
|
||||
|
|
@ -160,9 +151,6 @@ def run_scan():
|
|||
f2 = os.path.join(prefix, f)
|
||||
if f1 != f2 and os.path.exists(f1) and os.path.exists(f2):
|
||||
logger.debug('"%s" vs "%s"', f1, f2)
|
||||
os.chmod(f2, stat.S_IWRITE)
|
||||
os.unlink(f2)
|
||||
continue
|
||||
else:
|
||||
ids.add(id)
|
||||
|
||||
|
|
@ -191,8 +179,6 @@ 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 '')
|
||||
i.remove_file()
|
||||
missing = ids - library_items
|
||||
if missing:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue