Prevent non-integer ivl when importing from Mnemosyne

A reddit user had a few issues when importing from Mnemosyne, one of which was non-integer values interpreted as "v2 scheduler bug". I assume that's the line where they originated.
https://www.reddit.com/r/Anki/comments/cxcv27/what_just_happened_cards_with_v2_scheduler_bug/
This commit is contained in:
Blauelf 2019-08-30 14:56:44 +02:00 committed by GitHub
parent 8d5c0f4853
commit 672e19df85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,7 +76,7 @@ acq_reps+ret_reps, lapses, card_type_id from cards"""):
c.lapses = row[7]
# ivl is inferred in mnemosyne
next, prev = row[3:5]
c.ivl = max(1, (next - prev)/86400)
c.ivl = max(1, (next - prev)//86400)
# work out how long we've got left
rem = int((next - time.time())/86400)
c.due = self.col.sched.today+rem