diff --git a/pylib/anki/consts.py b/pylib/anki/consts.py index 58af8955b..363ef1b9d 100644 --- a/pylib/anki/consts.py +++ b/pylib/anki/consts.py @@ -15,6 +15,7 @@ NEW_CARDS_RANDOM = 0 NEW_CARDS_DUE = 1 # Queue types +QUEUE_TYPE_MANUALLY_BURIED = -3 QUEUE_TYPE_NEW = 0 QUEUE_TYPE_LRN = 1 diff --git a/pylib/anki/find.py b/pylib/anki/find.py index 45fa8851d..e44726153 100644 --- a/pylib/anki/find.py +++ b/pylib/anki/find.py @@ -278,7 +278,7 @@ select distinct(n.id) from cards c, notes n where c.nid=n.id and """ elif val == "suspended": return "c.queue = -1" elif val == "buried": - return "c.queue in (-2, -3)" + return f"c.queue in (-2, {QUEUE_TYPE_MANUALLY_BURIED})" elif val == "due": return f""" (c.queue in (2,3) and c.due <= %d) or diff --git a/pylib/anki/schedv2.py b/pylib/anki/schedv2.py index efc6030c5..0c70e399b 100644 --- a/pylib/anki/schedv2.py +++ b/pylib/anki/schedv2.py @@ -28,7 +28,7 @@ CARD_TYPE_RELEARNING = 3 QUEUE_TYPE_PREVIEW = 4 QUEUE_TYPE_DAY_LEARN_RELEARN = 3 QUEUE_TYPE_SIBLING_BURIED = -2 -QUEUE_TYPE_MANUALLY_BURIED = -3 + # revlog types: 0=lrn, 1=rev, 2=relrn, 3=early review # positive revlog intervals are in days (rev), negative in seconds (lrn) # odue/odid store original due/did when cards moved to filtered deck diff --git a/pylib/tests/test_schedv2.py b/pylib/tests/test_schedv2.py index 2ab46fca5..22fef573c 100644 --- a/pylib/tests/test_schedv2.py +++ b/pylib/tests/test_schedv2.py @@ -624,7 +624,7 @@ def test_bury(): # burying d.sched.buryCards([c.id], manual=True) # pylint: disable=unexpected-keyword-arg c.load() - assert c.queue == -3 + assert c.queue == QUEUE_TYPE_MANUALLY_BURIED d.sched.buryCards([c2.id], manual=False) # pylint: disable=unexpected-keyword-arg c2.load() assert c2.queue == -2 @@ -1226,7 +1226,7 @@ def test_moveVersions(): col.sched.answerCard(c, 1) col.sched.buryCards([c.id]) c.load() - assert c.queue == -3 + assert c.queue == QUEUE_TYPE_MANUALLY_BURIED # revert to version 1 col.changeSchedulerVer(1)