mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
ignore >100MB files
This commit is contained in:
parent
3ee1937310
commit
dd2b6cb07d
1 changed files with 5 additions and 1 deletions
|
@ -381,9 +381,13 @@ create table meta (dirMod int, lastUsn int); insert into meta values (0, 0);
|
|||
if self.hasIllegal(f):
|
||||
continue
|
||||
# empty files are invalid; clean them up and continue
|
||||
if not os.path.getsize(f):
|
||||
sz = os.path.getsize(f)
|
||||
if not sz:
|
||||
os.unlink(f)
|
||||
continue
|
||||
if sz > 100*1024*1024:
|
||||
self.col.log("ignoring file over 100MB", f)
|
||||
continue
|
||||
# check encoding
|
||||
if not isMac:
|
||||
normf = unicodedata.normalize("NFC", f)
|
||||
|
|
Loading…
Reference in a new issue