mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
add decimal ivl fix to fixIntegrity()
This commit is contained in:
parent
104b77b53f
commit
41f1ef02de
1 changed files with 5 additions and 0 deletions
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue