mirror of
https://github.com/ankitects/anki.git
synced 2025-11-08 21:57:12 -05:00
don't leave stale entries in media db if just scanning
This commit is contained in:
parent
4e5b725166
commit
acb72327b2
1 changed files with 2 additions and 1 deletions
|
|
@ -161,10 +161,11 @@ def rebuildMediaDir(deck, delete=False, dirty=True):
|
|||
unused.append(file)
|
||||
# optionally delete
|
||||
if delete:
|
||||
removeUnusedMedia(deck)
|
||||
for f in unused:
|
||||
path = os.path.join(mdir, f)
|
||||
os.unlink(path)
|
||||
# remove entries in db for unused media
|
||||
removeUnusedMedia(deck)
|
||||
# check md5s are up to date
|
||||
update = []
|
||||
for (file, created, md5) in deck.s.all(
|
||||
|
|
|
|||
Loading…
Reference in a new issue