From c6cc874011d8a8ad9ab56a6d3ad272f168e5e28f Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 5 Jun 2012 19:30:13 +0900 Subject: [PATCH] fix failed+suspended upgrade --- anki/upgrade.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/anki/upgrade.py b/anki/upgrade.py index cd36f9379..09c8938e5 100644 --- a/anki/upgrade.py +++ b/anki/upgrade.py @@ -684,10 +684,10 @@ and ord = ? limit 1""", m['id'], t['ord']): # and failed cards left = len(col.decks.confForDid(1)['lapse']['delays'])*1001 col.db.execute(""" -update cards set left=?,type=1,queue=1,ivl=1 where type=1 and ivl <= 1""", - left) +update cards set left=?,type=1,queue=1,ivl=1 where type=1 and ivl <= 1 +and queue>=0""", left) col.db.execute(""" -update cards set odue=?,left=?,type=2 where type=1 and ivl > 1""", +update cards set odue=?,left=?,type=2 where type=1 and ivl > 1 and queue>=0""", col.sched.today+1, left) # and due cards col.db.execute("""