mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 14:17:13 -05:00
make sure unused media exist before deleting them
This commit is contained in:
parent
71ff86e3f3
commit
5b61db7d0a
1 changed files with 2 additions and 1 deletions
|
|
@ -982,6 +982,7 @@ will be lost. Continue?"""))
|
||||||
mdir = self.col.media.dir()
|
mdir = self.col.media.dir()
|
||||||
for f in unused:
|
for f in unused:
|
||||||
path = os.path.join(mdir, f)
|
path = os.path.join(mdir, f)
|
||||||
|
if os.path.exists(path):
|
||||||
send2trash(path)
|
send2trash(path)
|
||||||
tooltip(_("Deleted."))
|
tooltip(_("Deleted."))
|
||||||
diag.close()
|
diag.close()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue