fix import of suspended anki1 cards (#565)
This commit is contained in:
parent
0a0d6bcfe6
commit
17b68d5dc0
@ -256,7 +256,7 @@ class Anki2Importer(Importer):
|
||||
card[4] = intTime()
|
||||
card[5] = usn
|
||||
# review cards have a due date relative to collection
|
||||
if card[7] in (2, 3):
|
||||
if card[7] in (2, 3) or card[6] == 2:
|
||||
card[8] -= aheadBy
|
||||
# if odid true, convert card from filtered to normal
|
||||
if card[15]:
|
||||
|
BIN
tests/support/suspended12.anki
Normal file
BIN
tests/support/suspended12.anki
Normal file
Binary file not shown.
@ -163,6 +163,16 @@ def test_anki1_diffmodels():
|
||||
assert after == before + 1
|
||||
assert beforeModels == len(dst.models.all())
|
||||
|
||||
|
||||
def test_suspended():
|
||||
# create a new empty deck
|
||||
dst = getEmptyDeck()
|
||||
# import the 1 card version of the model
|
||||
tmp = getUpgradeDeckPath("suspended12.anki")
|
||||
imp = Anki1Importer(dst, tmp)
|
||||
imp.run()
|
||||
assert dst.db.scalar("select due from cards") < 0
|
||||
|
||||
def test_anki2_diffmodels():
|
||||
# create a new empty deck
|
||||
dst = getEmptyDeck()
|
||||
|
Loading…
Reference in New Issue
Block a user