From 4b53271ad0582f6770781058a75a2c71daccc4e5 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 18 Feb 2020 11:00:26 +1000 Subject: [PATCH] don't error when fuzz is 0 https://anki.tenderapp.com/discussions/ankidesktop/38956-bug-report-sched2-anki2120 --- pylib/anki/schedv2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylib/anki/schedv2.py b/pylib/anki/schedv2.py index 8ce085f58..d4607efdc 100644 --- a/pylib/anki/schedv2.py +++ b/pylib/anki/schedv2.py @@ -671,7 +671,7 @@ did = ? and queue = {QUEUE_TYPE_DAY_LEARN_RELEARN} and due <= ? limit ?""", if card.due < self.dayCutoff: # add some randomness, up to 5 minutes or 25% maxExtra = min(300, int(delay * 0.25)) - fuzz = random.randrange(0, maxExtra) + fuzz = random.randrange(0, max(1, maxExtra)) card.due = min(self.dayCutoff - 1, card.due + fuzz) card.queue = 1 if card.due < (intTime() + self.col.conf["collapseTime"]):