mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
make sure card count is properly updated in importing
This commit is contained in:
parent
932440165a
commit
0d0b9fc81e
1 changed files with 3 additions and 1 deletions
|
@ -172,9 +172,11 @@ where factId in (%s)""" % ",".join([str(s) for s in factIds]))
|
|||
# and cards
|
||||
self.deck.updateProgress()
|
||||
now = time.time()
|
||||
active = 0
|
||||
for cm in self.model.cardModels:
|
||||
self._now = now
|
||||
if cm.active:
|
||||
active += 1
|
||||
data = [self.addMeta({
|
||||
'id': genID(),
|
||||
'factId': factIds[m],
|
||||
|
@ -187,7 +189,7 @@ where factId in (%s)""" % ",".join([str(s) for s in factIds]))
|
|||
data)
|
||||
self.deck.updateProgress()
|
||||
self.deck.updateCardsFromFactIds(factIds)
|
||||
self.deck.cardCount += len(cards)
|
||||
self.deck.cardCount += len(cards) * active
|
||||
self.total = len(factIds)
|
||||
|
||||
def addMeta(self, data, card):
|
||||
|
|
Loading…
Reference in a new issue