Merge pull request #327 from Blauelf/patch-1

Prevent non-integer ivl when importing from Mnemosyne
This commit is contained in:
Damien Elmes 2019-08-31 11:34:54 +10:00 committed by GitHub
commit a609633bb7
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] c.lapses = row[7]
# ivl is inferred in mnemosyne # ivl is inferred in mnemosyne
next, prev = row[3:5] 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 # work out how long we've got left
rem = int((next - time.time())/86400) rem = int((next - time.time())/86400)
c.due = self.col.sched.today+rem c.due = self.col.sched.today+rem