From 41f1ef02de910f61370414d3a3718d0d7d201fa8 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 29 Jan 2019 08:17:24 +1000 Subject: [PATCH] add decimal ivl fix to fixIntegrity() --- anki/collection.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/anki/collection.py b/anki/collection.py index 5b80b398b..b2f26c97e 100644 --- a/anki/collection.py +++ b/anki/collection.py @@ -850,6 +850,11 @@ and type = 0""", intTime(), self.usn()) self.db.execute( "update cards set due = ?, ivl = 1, mod = ?, usn = ? where id in %s" % ids2str(ids), self.sched.today, intTime(), self.usn()) + # v2 sched had a bug that could create decimal intervals + curs = self.db.cursor() + curs.execute("update cards set ivl=round(ivl) where ivl!=round(ivl)") + if curs.rowcount: + problems.append("Fixed %d cards with v2 scheduler decimal interval bug." % curs.rowcount) # and finally, optimize self.optimize() newSize = os.stat(self.path)[stat.ST_SIZE]