From 17b68d5dc07c7d4ae6ab612f5ac79a947e1ed894 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 23 Jan 2013 15:28:11 +0900 Subject: [PATCH] fix import of suspended anki1 cards (#565) --- anki/importing/anki2.py | 2 +- tests/support/suspended12.anki | Bin 0 -> 63488 bytes tests/test_importing.py | 10 ++++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tests/support/suspended12.anki diff --git a/anki/importing/anki2.py b/anki/importing/anki2.py index 0df5e39ab..7dc64e4e2 100644 --- a/anki/importing/anki2.py +++ b/anki/importing/anki2.py @@ -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]: diff --git a/tests/support/suspended12.anki b/tests/support/suspended12.anki new file mode 100644 index 0000000000000000000000000000000000000000..5117847dbf10c899486a1ab38f0de471b55eb0f4 GIT binary patch literal 63488 zcmeHw3wRsHedq2D1P~M-)`LM9nb8UqMM8Y-1B(asGDA@oqo+m5vFrHcC9ohj!h^yB zB58hVLP>t6Zfe&~>J*pDrSUnweoh=GspEY1*WAU9@7hZ)wG&^HvoDEVJE@b49mj3I zx=p|SXLc9Z1s2e=t|ae@TI|gH=Rg1X&CJfsfBrK&dChLMps=Z2J|h=ck@8S9ORW&uN+gAxt*$3$mJIf^EM|gX3x?G z8DC({8v4YMf;^R0v|KTtP&DHQjU5;tJvh!D9R0xVan|r;`? z2id)ccJCfwoBdfiqp%0ZuLB>8Zz8YA1trPu*u8Jm9uiE;T48b_n+Q4uY7nqr$*Z|! z&@r|B2PXE69=M*}HGVzYrzS(qp{1K>Umy^mPp&1I$tXz`B!U}b%Lwsmkd2g@R-Ch< zsW&T*vNXtJF0W3jSvkF5F3bdL(Mc*$43QzY4fMi|T?@DOt%h4iJKR>bz^%C%ZcVtj zyr>oKxK+ECi-3#3yAJ`k{lEL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