Merge pull request #49 from cecini/remshouldgravemax

Fix: server side graves's usn need not set as -1
This commit is contained in:
Vikash Kothary 2020-11-16 19:47:32 +00:00 committed by GitHub
commit bf0ad80dbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 4 deletions

View File

@ -64,7 +64,7 @@ class CollectionWrapper:
return col
def _get_collection(self):
col = anki.storage.Collection(self.path)
col = anki.storage.Collection(self.path, server=True)
# Ugly hack, replace default media manager with our custom one
col.media.close()

View File

@ -185,8 +185,6 @@ from notes where %s""" % lim, self.maxUsn)
return dict(cards=cards, notes=notes, decks=decks)
def remove(self, graves):
# pretend to be the server so we don't set usn = -1
self.col.server = True
# notes first, so we don't end up with duplicate graves
self.col._remNotes(graves['notes'])
@ -196,7 +194,6 @@ from notes where %s""" % lim, self.maxUsn)
for oid in graves['decks']:
self.col.decks.rem(oid)
self.col.server = False
# Models
##########################################################################