FooSoft / anki-connect

Anki plugin to expose a remote API for creating flash cards.
https://foosoft.net/projects/anki-connect/
Other
1.92k stars 218 forks source link

Return deckName in notesInfo. #375

Closed Akida31 closed 1 year ago

Akida31 commented 1 year ago

If I'm not wrong there was previously no way to get the name (or id) of the deck the note belongs to.

I've tested my changes with python3.10. Is there anything else I have (or can) do?

Akida31 commented 1 year ago

Ok I discovered that my approach didn't work in general. It returns the deck associated with the model and not with the note. This became a problem if the model is used in multiple decks. Instead I found a (probably hacky) way around and maybe it is interesting for others: You can use 'cards' in 'notesInfo' to get the ids of all associated cards and check then (with 'cardsInfo') that all cards have the same deck and use this