jdlorimer / chinese-support-redux

Anki add-on providing support for Chinese study
https://ankiweb.net/shared/info/1128979221
GNU General Public License v3.0
100 stars 50 forks source link

Fix bulk fill for usage #196

Closed spolcyn closed 2 years ago

spolcyn commented 3 years ago

Previously, if there existed any notes in the target deck that didn't have one of the hanzi fields, the get_hanzi step would fail as a result of cleanup raising a ValueError if it received text=None.

This PR modifies the logic so that presence of a hanzi field is verified before getting the hanzi itself.

It also modifies the behavior such that cards that do not have usages filled are marked as failed. Otherwise, the user doesn't know why many cards did not have usages filled.

Relevant to #177.

Testing Strategy: All unittest tests pass