Ajatt-Tools / anki.koplugin

KOReader plugin enabling Anki card generations for words looked up in the internal dictionary.
49 stars 6 forks source link

No "Add to Anki" button, but appears in plug-in list #16

Closed risuko95 closed 8 months ago

risuko95 commented 8 months ago

I had the plugin working for a minute, but wasn't able to connect to ankiconnect. I realized I had missed putting in my IP address in the config file, so I added my IPv4 address (as I saw in a previous post). I did try to make a few cards before this, but since it wouldn't sync, it just stored them offline.

Starting up KOReader now though, the anki button disappeared and there isn't any editing options in the toolbar.

I took a look at the crash log and saw a few instances of this line:
ERROR Failed to initialize anki plugin: plugins/anki.koplugin/ankiconnect.lua:277: attempt to index local 'note' (a nil value)

Maybe I entered the IP incorrectly since that's the last thing I did, but I'm also trying to figure out what's going on with the error. Maybe they're connected?

nairyosangha commented 8 months ago

Sounds like at least one of the notes that are stored locally on your device is invalid somehow One of the lines in settings/anki.koplugin_notes.json must not be valid JSON

nairyosangha commented 8 months ago

I don't think it's connected to the wrong IP, since the IP isn't actually stored on that JSON, it crashes before ever trying to sync anything

risuko95 commented 8 months ago

I cleared the notes file and it looks like the problem is solved. Thank you!