anki-connect
anki-connect copied to clipboard
Make updateNoteFields update tags as well
updateNoteFields
doesn't update tags, but I'm not sure if this is an intentional choice or not. It seems like a common pattern would be (at least one that I use) is attempting to add a new note, and if it's a duplicate update it instead. Currently I can't just pass the note to updateNoteFields
and be done with it because I need to add tags separately with addTags
.
Do them both at once with multi.
Yup, that's how I'm doing it now: https://github.com/gsingh93/anki-csv-importer/blob/13929045943e7eb8e12a34e84460a2be0e1b9a6b/anki-csv-importer.py#L114-L121
It's just inconvenient and unexpected behavior.
The proposal seems a good one. I am currently using the API and it seems a bit inconsistent with how the update of the other fields are handled. It would be amazing if the edit of the tags could be done in updateNoteFields
Do them both at once with multi.
When wanting to set a note's tags to some list then using multi
there would still be two commands to run:
- run a
notesInfo
on a note to get the currently present tag list - create a multi that (1) removes tags not in the "wanted tags" list (2) adds missing tags
Would it be be difficult to add this to the updateNoteFields
action itself?
I am using this API,but it literally can't update tags. if it could do it, it will save my lots of times.