From 0c85397461cceb82e0e3a69751248e4854f951d2 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 20 May 2020 14:13:40 +1000 Subject: [PATCH] fix extending limits in custom study https://anki.tenderapp.com/discussions/beta-testing/1967-2126-189-g7384df8f-crash-at-note-types-fields-save --- pylib/anki/schedv2.py | 2 +- rslib/src/decks/schema11.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pylib/anki/schedv2.py b/pylib/anki/schedv2.py index fc7c94eaa..12bc58277 100644 --- a/pylib/anki/schedv2.py +++ b/pylib/anki/schedv2.py @@ -200,7 +200,7 @@ order by due""" cur = self.col.decks.current() parents = self.col.decks.parents(cur["id"]) children = [ - self.col.decks.get(did) for did in self.col.decks.child_ids(cur["id"]) + self.col.decks.get(did) for did in self.col.decks.child_ids(cur["name"]) ] for g in [cur] + parents + children: self._update_stats(g, "new", -new) diff --git a/rslib/src/decks/schema11.rs b/rslib/src/decks/schema11.rs index c7616d35d..ea55fb743 100644 --- a/rslib/src/decks/schema11.rs +++ b/rslib/src/decks/schema11.rs @@ -261,8 +261,9 @@ impl From<&DeckCommonSchema11> for DeckCommon { // since we're combining the day values into a single value, // any items from an earlier day need to be reset let mut today = common.today.clone(); - // time is always updated, so will always be the latest - let max_day = today.time.day; + // study will always update 'time', but custom study may only update + // 'rev' or 'new' + let max_day = today.time.day.max(today.new.day).max(today.rev.day); if today.lrn.day != max_day { today.lrn.amount = 0; }