mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 08:22:24 -04:00
don't report deletions when renamed, assert checksum on client
This commit is contained in:
parent
89a31fdc9a
commit
d0fa667717
2 changed files with 3 additions and 1 deletions
|
@ -209,7 +209,7 @@ values (:id, strftime('%s', 'now'))""", id=id)
|
|||
deck.flushMod()
|
||||
deck.save()
|
||||
deck.finishProgress()
|
||||
return missingFileCount, unusedFileCount
|
||||
return missingFileCount, unusedFileCount - len(renamedFiles)
|
||||
|
||||
def mediaRefs(string):
|
||||
"Return list of (fullMatch, filename, replacementString)."
|
||||
|
|
|
@ -1103,6 +1103,8 @@ class BulkMediaSyncerProxy(HttpSyncServerProxy):
|
|||
return ret
|
||||
|
||||
def addFile(self, fname, data):
|
||||
oldsum = os.path.splitext(fname)[0]
|
||||
assert oldsum == checksum(data)
|
||||
return self.runCmd("addFile", fname=fname, data=data)
|
||||
|
||||
def runCmd(self, action, **args):
|
||||
|
|
Loading…
Reference in a new issue