mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
make sure to update counts after addcards()
This commit is contained in:
parent
02e1fed2ef
commit
5e5381d66f
1 changed files with 3 additions and 1 deletions
|
@ -828,7 +828,7 @@ and due < :now""", now=time.time())
|
||||||
return models
|
return models
|
||||||
|
|
||||||
def addCards(self, fact, cardModelIds):
|
def addCards(self, fact, cardModelIds):
|
||||||
"Caller must flush first, flushMod after, and rebuild priorities."
|
"Caller must flush first, flushMod after, rebuild priorities."
|
||||||
for cardModel in self.availableCardModels(fact, False):
|
for cardModel in self.availableCardModels(fact, False):
|
||||||
if cardModel.id not in cardModelIds:
|
if cardModel.id not in cardModelIds:
|
||||||
continue
|
continue
|
||||||
|
@ -837,6 +837,8 @@ select count(id) from cards
|
||||||
where factId = :fid and cardModelId = :cmid""",
|
where factId = :fid and cardModelId = :cmid""",
|
||||||
fid=fact.id, cmid=cardModel.id) == 0:
|
fid=fact.id, cmid=cardModel.id) == 0:
|
||||||
card = anki.cards.Card(fact, cardModel)
|
card = anki.cards.Card(fact, cardModel)
|
||||||
|
self.cardCount += 1
|
||||||
|
self.newCount += 1
|
||||||
self.setModified()
|
self.setModified()
|
||||||
|
|
||||||
def factIsInvalid(self, fact):
|
def factIsInvalid(self, fact):
|
||||||
|
|
Loading…
Reference in a new issue