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
This commit is contained in:
Abdo 2021-11-12 05:29:48 +03:00 committed by GitHub
parent fbf2852b1a
commit 44b014e937
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()