cadrianxyz / obsidian-auto-anki

Using AI to automate card creation for Spaced Repetion in Anki
MIT License
41 stars 10 forks source link

Export is mistakenly reported as successful when it's not #21

Open belgio99 opened 9 months ago

belgio99 commented 9 months ago

In some cases, the Anki export is mistakenly reported as successful, when nothing is actually imported into Anki. Even if the documentation says Anki Connect should return null, in fact it's returning [null] (Array with a single value: null). The nullish operator doesn't distinguish and incorrectly says that 1 card was exported to Anki (when it's not).

The checks I added fix this subtle bug, and report the user if the export was unsuccessful.

Btw thank you for the plugin: it really is a timesaver!