mirror of
https://github.com/ankitects/anki.git
synced 2025-11-10 14:47:12 -05:00
return newly created card ids when generating cards
This commit is contained in:
parent
582a9dd290
commit
09f51e27f0
1 changed files with 3 additions and 0 deletions
|
|
@ -1107,6 +1107,7 @@ and due < :now""" % self.forceIndex("ix_cards_priorityDue"), now=time.time())
|
|||
|
||||
def addCards(self, fact, cardModelIds):
|
||||
"Caller must flush first, flushMod after, rebuild priorities."
|
||||
ids = []
|
||||
for cardModel in self.availableCardModels(fact, False):
|
||||
if cardModel.id not in cardModelIds:
|
||||
continue
|
||||
|
|
@ -1120,7 +1121,9 @@ where factId = :fid and cardModelId = :cmid""",
|
|||
self.updatePriority(card)
|
||||
self.cardCount += 1
|
||||
self.newCount += 1
|
||||
ids.append(card.id)
|
||||
self.setModified()
|
||||
return ids
|
||||
|
||||
def factIsInvalid(self, fact):
|
||||
"True if existing fact is invalid. Returns the error."
|
||||
|
|
|
|||
Loading…
Reference in a new issue