From 5eb00296d52f342e8c4366c1bc5dfb9cf0989300 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 17 Dec 2010 01:46:14 +0900 Subject: [PATCH] always space rev cards to the next day --- anki/deck.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/anki/deck.py b/anki/deck.py index d029a1213..1d31afd3f 100644 --- a/anki/deck.py +++ b/anki/deck.py @@ -877,12 +877,18 @@ where id in """ select count() from cards where factId = :fid and id != :cid and combinedDue < :cut and type = 2 +""", cid=card.id, fid=card.factId, cut=self.dueCutoff) + # update due counts + self.revCount -= self.s.scalar(""" +select count() from cards +where factId = :fid and id != :cid +and combinedDue < :cut and type = 1 """, cid=card.id, fid=card.factId, cut=self.dueCutoff) # space cards self.s.statement(""" update cards set combinedDue = (case -when type = 1 then :cut - 1 +when type = 1 then :daycut when type = 2 then :new end), modified = :now, isDue = 0 @@ -890,7 +896,8 @@ where id != :id and factId = :factId and combinedDue < :cut and type between 1 and 2""", id=card.id, now=time.time(), factId=card.factId, - cut=self.dueCutoff, new=new) + cut=self.dueCutoff, daycut=self.failedCutoff, + new=new) # update local cache of seen facts self.spacedFacts[card.factId] = new