Add support for canAddNotesWithDetail with fallback to canAddNotes if not supported#2220
Conversation
|
I haven't properly looked at the code yet but the reason it was reverted was for ankiconnect android not old pc versions of ankiconnect. Yomitan can detect if it's running on android if you'd like to use that as a predictor for which api call to try first to avoid sending a unsupported call to ankiconnect android when it is known that Yomitan is running on android. |
f7f08b8 to
62fd442
Compare
|
canAddNotesWithErrorDetail was implemented a while ago in Ankiconnect Android, so it should be supported (should probably be tested to be sure). KamWithK/AnkiconnectAndroid#60 |
|
Thank you for the clarification. Sorry for the confusion. This can just go back to trying |
62fd442 to
9b1ff24
Compare
Kuuuube
left a comment
There was a problem hiding this comment.
Looks good. Thank you for the contribution!
If canAddNotesWithDetail is implemented in anki-connect we can save up another api call, if not fallback to using two.
canAddNotesWithDetail seems to have been used in original logic as implemented in #693.
It was reverted to using two canAddNotes #827 due to bugs some users were having due to an old anki-connect.
But I think a fallback should have been provided instead (comment in code actually mentions "if older version" but not checks are being done).
#827 also is responsible for the dead code I removed in #2218 so it might be worth checking that out.