mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 06:07:11 -05:00
don't die if src collection is missing media folder
This commit is contained in:
parent
e3da64f00b
commit
3f01b1ef59
1 changed files with 4 additions and 1 deletions
|
|
@ -271,7 +271,10 @@ insert or ignore into revlog values (?,?,?,?,?,?,?,?,?)""", revlog)
|
|||
def _importStaticMedia(self):
|
||||
# Import any '_foo' prefixed media files regardless of whether
|
||||
# they're used on notes or not
|
||||
for fname in os.listdir(self.src.media.dir()):
|
||||
dir = self.src.media.dir()
|
||||
if not os.path.exists(dir):
|
||||
return
|
||||
for fname in os.listdir(dir):
|
||||
if fname.startswith("_") and not self.dst.media.have(fname):
|
||||
self._writeDstMedia(fname, self._srcMediaData(fname))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue