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[4] = intTime()
|
||||||
card[5] = usn
|
card[5] = usn
|
||||||
# review cards have a due date relative to collection
|
# 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
|
card[8] -= aheadBy
|
||||||
# if odid true, convert card from filtered to normal
|
# if odid true, convert card from filtered to normal
|
||||||
if card[15]:
|
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 after == before + 1
|
||||||
assert beforeModels == len(dst.models.all())
|
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():
|
def test_anki2_diffmodels():
|
||||||
# create a new empty deck
|
# create a new empty deck
|
||||||
dst = getEmptyDeck()
|
dst = getEmptyDeck()
|
||||||
|
Loading…
Reference in New Issue
Block a user