Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Connecting to Koreader #47

Closed
unacceptablet opened this issue Jul 14, 2023 · 5 comments
Closed

FR: Connecting to Koreader #47

unacceptablet opened this issue Jul 14, 2023 · 5 comments

Comments

@unacceptablet
Copy link

Greetings!

My device: Onyx Boox Leaf 2 (android 11)

I have installed a Koreader plugin using this tutorial guide: https://github.com/Ajatt-Tools/anki.koplugin
Then I installed AnkiconnectAndroid, put http://localhost:8765/ in CORS Host settings, start service. When I press add to anki in Koreader, I get these errors:

image

Any solutions?

@KamWithK
Copy link
Owner

I've never tried to use CORS nor KOreader with Ankiconnect Android before personally, so maybe @Aquafina-water-bottle you would have a better idea of what could be going wrong?

@Twinov
Copy link
Contributor

Twinov commented Jul 14, 2023

Read the error message and looked at the code, right now the parser has
.get("audio").getAsJsonArray();
but looks like this request is a single object and not an array. According to https://github.com/FooSoft/anki-connect#addnote it's a valid request, but I have a feeling #43 might fix this (or at least that should go in first and then fix applied after if not)

Sorry I haven't gotten around to looking at it, I'll look at #43 soon 😅

@Bluemoondragon07
Copy link

I spent hours trying to do the exact same thing on my Meebook M7 and got the exact same errors. Found a workaround yet?

@Bluemoondragon07
Copy link

Different errors now, actually.

2 note(s) failed to sync:
- Couldn't get deck IDjava.lang.Exception: Couldn't get deck ID
at
com.kamwithk.ankiconnectandroid.ankidroid_api.DeckAPI.getDeckID(DeckAPI.java:50)
at
com.kamwithk.ankiconnectandroid.ankidroid_api.IntegratedAPI.addNote(IntegratedAPI.java:150)
at

...and so on and so forth. I'll attach a screenshot once I find out how to do so on this device.

@nairyosangha
Copy link

Different errors now, actually.

2 note(s) failed to sync:
- Couldn't get deck IDjava.lang.Exception: Couldn't get deck ID
at
com.kamwithk.ankiconnectandroid.ankidroid_api.DeckAPI.getDeckID(DeckAPI.java:50)
at
com.kamwithk.ankiconnectandroid.ankidroid_api.IntegratedAPI.addNote(IntegratedAPI.java:150)
at

...and so on and so forth. I'll attach a screenshot once I find out how to do so on this device.

Hey, I don't think this is an error, or at least not something wrong with this Ankiconnect implementation. It's showing an error because it couldn't map whatever deck name you gave it to a deck id, so that name is probably just wrong on your end.

These errors could be clearer though IMO, it's a bit strange to get a 'Couldn't get deck ID' when trying to add a card, would be more clear if it just told you it couldn't find the deck with name X. And maybe you don't really need the whole stacktrace in the error 😄 although it was helpful to check

As far as I can tell this issue can be closed because it indeed looks like the new implentation handles the singular 'audio' object fine now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants