From 44b014e93742de21b793bd01eae748145beceaf5 Mon Sep 17 00:00:00 2001 From: Abdo Date: Fri, 12 Nov 2021 05:29:48 +0300 Subject: [PATCH] Fix incorrect card count in timebox after undo (#1485) * Fix incorrect card count in timebox after undo Can happen after undoing reviews done in a previous study session. * Fix lints --- pylib/anki/collection.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pylib/anki/collection.py b/pylib/anki/collection.py index 9a88d5dba..8d38229d5 100644 --- a/pylib/anki/collection.py +++ b/pylib/anki/collection.py @@ -114,6 +114,7 @@ class Collection(DeprecatedNamesMixin): self.tags = TagManager(self) self.conf = ConfigManager(self) self._load_scheduler() + self._startReps = 0 # pylint: disable=invalid-name def name(self) -> Any: return os.path.splitext(os.path.basename(self.path))[0] @@ -992,6 +993,7 @@ class Collection(DeprecatedNamesMixin): type = ("new", "lrn", "rev")[idx] self.sched._updateStats(card, type, -1) self.sched.reps -= 1 + self._startReps -= 1 # and refresh the queues self.sched.reset()