add decimal ivl fix to fixIntegrity()

This commit is contained in:
Damien Elmes 2019-01-29 08:17:24 +10:00
parent 104b77b53f
commit 41f1ef02de

View file

@ -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]