migaku-official / Migaku-Kanji-Addon

Learn kanji within the context of the vocab in your Anki collection. Comes with a powerful lookup browser.
https://migaku.io
GNU General Public License v3.0
56 stars 12 forks source link

[BUG] setting a custom keyword for a character doesn't update related production characters #205

Open izik1 opened 10 months ago

izik1 commented 10 months ago

Describe the bug Kinda a two for one in the same spot setting a custom keyword for a character doesn't update the keyword in production characters it's a primitive of/are primitives of it also, by the same effect, updating the story/keyword of a card updates all recognition cards.

To Reproduce Steps to reproduce the behavior:

This query filter is ~off~ incorrect: https://github.com/migaku-official/Migaku-Kanji-Addon/blob/88e01ba3ff86da2a2d7c05dfcc31db82112e65b0/addon/kanji.py#L569-L571

Expected behavior When updating a keyword / story, all related notes should update (to have the right keyword for the original note) and only those notes should update.

Desktop (please complete the following information):

Additional context I'm willing to fix this (even have a partial fix ready), just want to write it down and be told "yeah, sure"

Screenshots If applicable, add screenshots to help explain your problem.

mjuhanne commented 10 months ago

Ah, good catch! I had already fixed the 'every recognition card wants to sync' problem here ages ago in my repository but I missed including that into previous PR.
What still needs to be done is iteratively update also every child-note in the primitive_of list (function refresh_notes_for_character).

If you have time, please do contribute with your fix, test it and make a PR (I'm currently tied up with another feature I'm working on).