From 4cce768c702fb02b092f62699a61f3575087871b Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 27 Oct 2010 21:03:48 +0900 Subject: [PATCH] update search code for new scheduler --- anki/deck.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/anki/deck.py b/anki/deck.py index 2f107a09e..7c33df800 100644 --- a/anki/deck.py +++ b/anki/deck.py @@ -2513,19 +2513,19 @@ where id = :id""", pending) qquery += "select id from cards where type = %d" % n elif token == "delayed": qquery += ("select id from cards where " - "due < %d and isDue = 0 and " - "priority in (1,2,3,4)") % time.time() + "due < %d and combinedDue > %d and " + "type in (0,1,2)") % ( + self.dueCutoff, self.dueCutoff) elif token == "suspended": qquery += ("select id from cards where " "priority = -3") - elif token == "inactive": - qquery += ("select id from cards where " - "priority = 0") elif token == "leech": - qquery += ("select id from cards where noCount >= (select value from deckvars where key = \"leechFails\")") + qquery += ( + "select id from cards where noCount >= (select value " + "from deckvars where key = 'leechFails')") else: # due qquery += ("select id from cards where " - "type in (0,1) and isDue = 1") + "type in (0,1) and combinedDue < %d") % self.dueCutoff elif type == SEARCH_FID: if fidquery: if isNeg: