anki-connect icon indicating copy to clipboard operation
anki-connect copied to clipboard

Make updateNoteFields update tags as well

Open gsingh93 opened this issue 4 years ago • 5 comments

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.

gsingh93 avatar Jun 26 '20 18:06 gsingh93

Do them both at once with multi.

snoyes avatar Nov 04 '20 18:11 snoyes

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.

gsingh93 avatar Nov 04 '20 21:11 gsingh93

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

reuseman avatar Dec 10 '20 16:12 reuseman

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?

eyeinsky avatar Jul 08 '21 13:07 eyeinsky

I am using this API,but it literally can't update tags. if it could do it, it will save my lots of times.

xx299x avatar Jun 30 '22 10:06 xx299x