From 5bca5bc0daaa28a2871f8f5afefe768d6d2b3013 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 18 Jun 2009 03:13:58 +0900 Subject: [PATCH] make distinction between suspended/inactive --- anki/deck.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/anki/deck.py b/anki/deck.py index d9a69ccfa..82a88c36b 100644 --- a/anki/deck.py +++ b/anki/deck.py @@ -747,11 +747,18 @@ and priority in (1,2,3,4) and type in (0, 1)""", time=time) c) % c c2 = self.suspendedCardCount() if c2: - if c: + if spaceSusp: spaceSusp += "
" spaceSusp += ngettext('There is %d suspended card.', 'There are %d suspended cards.', c2) % c2 + c3 = self.inactiveCardCount() + if c3: + if spaceSusp: + spaceSusp += "
" + spaceSusp += ngettext('There is %d inactive card.', + 'There are %d inactive cards.', + c3) % c3 if spaceSusp: spaceSusp = "

" + spaceSusp return _('''\ @@ -871,7 +878,11 @@ group by cardTags.cardId""" % limit) def suspendedCardCount(self): return self.s.scalar(""" -select count(id) from cards where type in (0,1,2) and priority = 0""") +select count(id) from cards where priority = -3""") + + def inactiveCardCount(self): + return self.s.scalar(""" +select count(id) from cards where priority = 0""") def seenCardCount(self): return self.s.scalar( @@ -1859,7 +1870,7 @@ cardTags.tagId in %s""" % ids2str(ids) "priority in (1,2,3,4)") % time.time() elif token == "suspended": qquery += ("select id from cards where " - "priority in (-3, 0)") + "priority = -3") else: # due qquery += ("select id from cards where " "type in (0,1) and isDue = 1")