FooSoft / anki-connect

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

Name is not the best way to sync cards. #106

Open burtonator opened 5 years ago

burtonator commented 5 years ago

I've noticed two problems with anki connect which are somewhat related.

  1. People can have multiple note types by name "so 5 Basic types"

  2. The international Anki translates 'Basic' to the locale.

Both of these cause bugs bug #2 is hitting me hard.

Anyone not using the English version of Anki won't work with my app unfortunately.

burtonator commented 5 years ago

oh.. any advice here?

FooSoft commented 5 years ago

It doesn't matter what "Basic" is translated to, but if you have five of them, that would be a problem. I didn't even know that you could create multiple note types with the exact same name, that sounds like a terrible idea. That being said, do you have any suggestions on what a "fix" to that could be?

burtonator commented 5 years ago

I didn't either but one of our users said that he had multiple of them.

Is there an ID that can be used? I guess I could scan for ALL the cards but I don't think there's a stable way to refer to it. It would be nice if Anki just had a mapping for us already.

c-okelly commented 5 years ago

It's seem like a mistake that your users are creating multiple cards types with the same name. As they are card types / templates I really don't see any other way to choose what card type you are looking to create other then either specifying the name or ID number?

By default if you try to add a new card type and name it the same as an existing card it add a random string to the end.

As for the local language issue since there are only 4 base Anki card types maybe you should just try and translate them using the a predefined list? eg "Basic -> Basique" (French). Or pull the card types using anki-connect and let the users select from a drop down list.

c-okelly commented 5 years ago

Just looking at the code while thinking about #100 . It is definitely a bug to have created two models with the same unique name. The user would have to specifically create the model (code ensures at this point we get unique name no matter what the user does). User must then go and rename the model to an existing name (Rename process is not properly validated).