From ab9999dbc9ded74335f40fa5548cf0ebf4ad5050 Mon Sep 17 00:00:00 2001 From: Arthur Milchior Date: Sun, 1 Mar 2020 13:00:36 +0100 Subject: [PATCH] countsIdx return a queue type. I missed this constant before --- pylib/anki/sched.py | 6 +++--- pylib/anki/schedv2.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pylib/anki/sched.py b/pylib/anki/sched.py index 8e721fee0..e4afefce3 100644 --- a/pylib/anki/sched.py +++ b/pylib/anki/sched.py @@ -106,8 +106,8 @@ class Scheduler: counts = [self.newCount, self.lrnCount, self.revCount] if card: idx = self.countIdx(card) - if idx == 1: - counts[1] += card.left // 1000 + if idx == QUEUE_TYPE_LRN: + counts[QUEUE_TYPE_LRN] += card.left // 1000 else: counts[idx] += 1 @@ -139,7 +139,7 @@ order by due""" def countIdx(self, card: Card) -> int: if card.queue == QUEUE_TYPE_DAY_LEARN_RELEARN: - return 1 + return QUEUE_TYPE_LRN return card.queue def answerButtons(self, card: Card) -> int: diff --git a/pylib/anki/schedv2.py b/pylib/anki/schedv2.py index 142d2eef7..5307e8f90 100644 --- a/pylib/anki/schedv2.py +++ b/pylib/anki/schedv2.py @@ -161,7 +161,7 @@ order by due""" def countIdx(self, card: Card) -> int: if card.queue in (QUEUE_TYPE_DAY_LEARN_RELEARN, QUEUE_TYPE_PREVIEW): - return 1 + return QUEUE_TYPE_LRN return card.queue def answerButtons(self, card: Card) -> int: