mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
need to compare mediaList with nfd on macs
otherwise the server says we have file x and local code doesn't notice it already exists
This commit is contained in:
parent
636d70ab16
commit
ba589ac8cc
1 changed files with 6 additions and 3 deletions
|
@ -2,7 +2,6 @@
|
|||
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
|
||||
import os
|
||||
import re
|
||||
import urllib
|
||||
import unicodedata
|
||||
|
@ -505,8 +504,12 @@ create table log (fname text primary key, type int);
|
|||
need = []
|
||||
remove = []
|
||||
for f in files:
|
||||
if self.db.scalar("select 1 from log where fname=?", f):
|
||||
remove.append((f,))
|
||||
if isMac:
|
||||
name = unicodedata.normalize("NFD", f)
|
||||
else:
|
||||
name = f
|
||||
if self.db.scalar("select 1 from log where fname=?", name):
|
||||
remove.append((name,))
|
||||
else:
|
||||
need.append(f)
|
||||
self.db.executemany("delete from log where fname=?", remove)
|
||||
|
|
Loading…
Reference in a new issue