Closed josegaert closed 5 years ago
@kerrickstaley, @josegaert: It looks like the reason for this is that genanki writes multiple collections rows (one for each deck) to the apkg database instead of packing them all into a single collection row.
A potential fix could be instead of inserting into the col
table for each deck in deck.write_to_db, insert the default deck (is this required) once in pkg.write_to_db. Then, in each deck.write_to_db, select the decks column from col
append the decks info to that field and then update it in the col
table.
@sciencemanx makes sense. Want to take a stab at a PR? :)
Yah -- I should have some time over the weekend to give it a shot.
PR submitted and complete #20. Please review
This bug is fixed in version 0.6.4 (https://github.com/kerrickstaley/genanki/commit/53bc7b4e1be3f19af022ef293faa0040bc5c35ee).
Hello sciencemanx,
I got the issue again. But the behavior is different
"When I then load this apkg file into Anki, Anki adds all 6 cards that should be in deck1, deck2 and deck3 into only deck3."
Dear KerrickStaley,
Thank you for sharing your library. I think I might have found an issue.
Example code:
When I then load this apkg file into Anki, Anki adds all 6 cards that should be in deck1, deck2 and deck3 into only deck1.