mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
Merge branch 'newSpaced'
This commit is contained in:
commit
f2db5c27d6
1 changed files with 13 additions and 5 deletions
18
anki/deck.py
18
anki/deck.py
|
@ -701,11 +701,12 @@ and priority in (1,2,3,4) and type in (0, 1)""", time=time)
|
||||||
def deckFinishedMsg(self):
|
def deckFinishedMsg(self):
|
||||||
self.resetAfterReviewEarly()
|
self.resetAfterReviewEarly()
|
||||||
spaceSusp = ""
|
spaceSusp = ""
|
||||||
c = self.spacedCardCount()
|
#c = self.spacedCardCount()
|
||||||
newLeft = self.newCardsPerDay - self.newCardsToday()
|
#newLeft = self.newCardsPerDay - self.newCardsToday()
|
||||||
if c and newLeft:
|
c= self.newSpacedCount()
|
||||||
spaceSusp += ngettext('There is <b>%d</b> delayed card.',
|
if c: # and newLeft:
|
||||||
'There are <b>%d</b> delayed cards.',
|
spaceSusp += ngettext('There is <b>%d</b> delayed new card.',
|
||||||
|
'There are <b>%d</b> delayed new cards.',
|
||||||
c) % c
|
c) % c
|
||||||
c2 = self.suspendedCardCount()
|
c2 = self.suspendedCardCount()
|
||||||
if c2:
|
if c2:
|
||||||
|
@ -838,6 +839,13 @@ and due < :now""", now=time.time())
|
||||||
return self.s.scalar(
|
return self.s.scalar(
|
||||||
"select count(id) from cards where type = 2")
|
"select count(id) from cards where type = 2")
|
||||||
|
|
||||||
|
def newSpacedCount(self):
|
||||||
|
"Cards that are both spaced and new."
|
||||||
|
return self.s.scalar("""
|
||||||
|
select count(cards.id) from cards where
|
||||||
|
type = 2 and isDue = 0 and priority in (1,2,3,4) and combinedDue > :now
|
||||||
|
and due < :now""", now=time.time())
|
||||||
|
|
||||||
# Card predicates
|
# Card predicates
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue