Collection.media.illegal() was renamed to Collection.media.hasIllegal() in Anki 2.0.12.

This commit is contained in:
David Snopek 2013-12-31 20:21:38 +00:00 committed by jdoe0
parent f210f728ea
commit 0311e25574

View File

@ -174,8 +174,10 @@ class SyncMediaHandler(MediaSyncer):
csum = checksum(data)
name = meta[i.filename]
# can we store the file on this system?
# TODO: this function changed it's name in Anki 2.0.12 to media.hasIllegal()
if self.col.media.illegal(name):
# NOTE: this function changed it's name in Anki 2.0.12 to media.hasIllegal()
if hasattr(self.col.media, 'illegal') and self.col.media.illegal(name):
continue
if hasattr(self.col.media, 'hasIllegal') and self.col.media.hasIllegal(name):
continue
# save file
open(os.path.join(self.col.media.dir(), name), "wb").write(data)