From b6a3842fd97ac925ccf394a2e364d68207ea001a Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 19 May 2021 15:58:18 +1000 Subject: [PATCH] fix custom study in v3 scheduler --- pylib/anki/scheduler/v3.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pylib/anki/scheduler/v3.py b/pylib/anki/scheduler/v3.py index f367c6c0b..1f5820619 100644 --- a/pylib/anki/scheduler/v3.py +++ b/pylib/anki/scheduler/v3.py @@ -252,3 +252,11 @@ class Scheduler(SchedulerBaseWithLegacy): return self.col.db.list("select id from active_decks") except DBError: return [] + + # used by custom study; will likely be rolled into a separate routine + # in the future + def totalNewForCurrentDeck(self) -> int: + return self.col.db.scalar( + f""" +select count() from cards where queue={QUEUE_TYPE_NEW} and did in (select id from active_decks)""" + )