From 0d0b9fc81ef069b0c04b25e43d09e9bc6443fdef Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 4 Jul 2009 15:40:36 +0900 Subject: [PATCH] make sure card count is properly updated in importing --- anki/importing/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/anki/importing/__init__.py b/anki/importing/__init__.py index aebdaa5b2..3a36c0e3a 100644 --- a/anki/importing/__init__.py +++ b/anki/importing/__init__.py @@ -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):