From cf51f33c6689d333627e0f483cfc7be793f8b997 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 22 Oct 2013 14:20:31 +0900 Subject: [PATCH] add separate is:buried and use with filtered deck --- anki/find.py | 8 ++++++-- anki/sched.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/anki/find.py b/anki/find.py index d49212c6b..a07dd304e 100644 --- a/anki/find.py +++ b/anki/find.py @@ -3,10 +3,12 @@ # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import re +import sre_constants + from anki.utils import ids2str, splitFields, joinFields, intTime, fieldChecksum, stripHTMLMedia from anki.consts import * from anki.hooks import * -import sre_constants + # Find ########################################################################## @@ -257,7 +259,9 @@ select distinct(n.id) from cards c, notes n where c.nid=n.id and """+preds return "queue in (1, 3)" return "type = %d" % n elif val == "suspended": - return "c.queue in (-1, -2)" + return "c.queue = -1" + elif val == "buried": + return "c.queue = -2" elif val == "due": return """ (c.queue in (2,3) and c.due <= %d) or diff --git a/anki/sched.py b/anki/sched.py index 99fffa382..1ac07d282 100644 --- a/anki/sched.py +++ b/anki/sched.py @@ -945,7 +945,7 @@ select id from cards where did in %s and queue = 2 and due <= ? limit ?)""" def _fillDyn(self, deck): search, limit, order = deck['terms'][0] orderlimit = self._dynOrder(order, limit) - search += " -is:suspended -deck:filtered" + search += " -is:suspended -is:buried -deck:filtered" try: ids = self.col.findCards(search, order=orderlimit) except: