mdanki
mdanki copied to clipboard
Duplicates
This isn't necessarily an issue with mdanki, I am just curious how you manage duplicates.
For example, I add cards to my repo frequently. Once I am done adding some cards, I run mdanki. After this is done, if I just import the file directly I get duplicates in Anki. If I delete the deck and then add the new one, I lose all progress.
What does your workflow look like?
This appears to be an issue in the underlying library. https://github.com/repeat-space/anki-apkg-export/issues/37 calls attention to it. Essentially, https://github.com/repeat-space/anki-apkg-export/blob/master/src/exporter.js#L99 appears to show it using the timestamp of generation to create the card ID. I think if it switched to using something like a hash of the deckName and the card front, you could probably avoid the duplicate problem.
@DHNishi thanks for the investigation. I made a PR over there. We'll see if it gets in!
Thanks, @amorriscode, and @DHNishi for the investigation and the PR. I'll update the dependency when the PR'll be merged to anki-apkg-export
Hey all, sorry for the long time. I've released [email protected] with the patch from @amorriscode :+1:
@ashlinchak I made a PR. 😄
So I realized now that the update of anki-apkg-export doesn't quite solve the problem. The issue being that existing decks don't get loaded and updated. They are just completely regenerated.
Yeah, just checked it :) I believe having this is not enough as those variables are generated based on the topDeckId which is generated based on Date.now() anyway.
🤦♂ Sorry about that. I suppose the topDeckId should be based off of the deck name itself?
Made a new PR based on some of our ideas. Tested it with mdanki this time.
Not sure if it handles nested decks; that will require more research but it's a start.
So the issues is still here, are you guys moving on from mdanki? do you have some alternative suggestion?