Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

Allow interfacing with notes via GUID instead of note ID #358

Open
orgtre opened this issue Nov 19, 2022 · 1 comment
Open

Allow interfacing with notes via GUID instead of note ID #358

orgtre opened this issue Nov 19, 2022 · 1 comment

Comments

@orgtre
Copy link

orgtre commented Nov 19, 2022

All Anki-Connect actions operating on notes via some ID currently require note ID's ("noteId") as arguments and provide note ID's as return values. This severely limits the types of applications that can make use of Anki-Connect.

Note ID's are unsuitable as ID for many applications, especially those that involve multiple users, as they are only unique within a users profile. Just because of this, applications such as CrowdAnki and ki, had to write their own interface to Anki from scratch instead of making use of Anki-Connect. Moreover, several applications which rely fully on Anki-Connect are currently restricted in the features they can provide because of this limitation. Examples include org-anki, anki-editor, and my fork of it.

Anki notes are already stored with globally unique identifiers (GUIDs) in Anki's database, so it should not be very difficult to make use of them in Anki-Connect's actions. To enable a complete switch to GUIDs in the above mentioned applications it would be enough if the following actions were to (optionally) accept guid as input instead of noteId: notesInfo, updateNoteFields, deleteNotes, addTags, and removeTags; and if the following actions were to (optionally) return guid's instead noteId's: addNote and findNotes.

To people familiar with Anki-Connect's codebase: How feasible would this be? Any pointers on how to implement this? Would such a pull request have a chance of being accepted? Maybe someone else also has an interest in making this happen?

@FooSoft
Copy link
Owner

FooSoft commented Nov 19, 2022

I don't have a problem with this kind of a change; the main thing is that we don't want to break backwards compatibility with older clients that rely on note ID. This could be as simple as determining the type of the parameter at runtime and changing behavior accordingly.

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

No branches or pull requests

2 participants