mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
add separate is:buried and use with filtered deck
This commit is contained in:
parent
f8985c036c
commit
cf51f33c66
2 changed files with 7 additions and 3 deletions
|
@ -3,10 +3,12 @@
|
||||||
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import sre_constants
|
||||||
|
|
||||||
from anki.utils import ids2str, splitFields, joinFields, intTime, fieldChecksum, stripHTMLMedia
|
from anki.utils import ids2str, splitFields, joinFields, intTime, fieldChecksum, stripHTMLMedia
|
||||||
from anki.consts import *
|
from anki.consts import *
|
||||||
from anki.hooks import *
|
from anki.hooks import *
|
||||||
import sre_constants
|
|
||||||
|
|
||||||
# Find
|
# 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 "queue in (1, 3)"
|
||||||
return "type = %d" % n
|
return "type = %d" % n
|
||||||
elif val == "suspended":
|
elif val == "suspended":
|
||||||
return "c.queue in (-1, -2)"
|
return "c.queue = -1"
|
||||||
|
elif val == "buried":
|
||||||
|
return "c.queue = -2"
|
||||||
elif val == "due":
|
elif val == "due":
|
||||||
return """
|
return """
|
||||||
(c.queue in (2,3) and c.due <= %d) or
|
(c.queue in (2,3) and c.due <= %d) or
|
||||||
|
|
|
@ -945,7 +945,7 @@ select id from cards where did in %s and queue = 2 and due <= ? limit ?)"""
|
||||||
def _fillDyn(self, deck):
|
def _fillDyn(self, deck):
|
||||||
search, limit, order = deck['terms'][0]
|
search, limit, order = deck['terms'][0]
|
||||||
orderlimit = self._dynOrder(order, limit)
|
orderlimit = self._dynOrder(order, limit)
|
||||||
search += " -is:suspended -deck:filtered"
|
search += " -is:suspended -is:buried -deck:filtered"
|
||||||
try:
|
try:
|
||||||
ids = self.col.findCards(search, order=orderlimit)
|
ids = self.col.findCards(search, order=orderlimit)
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Reference in a new issue