Would you be open to a PR which would allows some add-ons to be plug and play.
As an add-on developer, I would like to be able to create scripts that would be applied when user download the add-on, so that they don’t have to restart. Depending on the add-on, it can be either really easy or almost impossible to do. For example, the add-ons which simply add an element to a hook can be executed any time. Actually, they can even be uninstalled as easily, by removing the functions from the hook.
The way I expect to do it is by doing the following changes:
add a preference, which will allow to disable this feature (for people who want to download code to read it without executing it. I know @ijgnd do it, I don’t know of anyone else)
In the manifest, allow a boolean “plugIn”. If this boolean is present and set to true, then the add-on downloader will execute the add-on on download and when the user enable the add-on in the add-on manager.
Add a method register_plug_off, which will take a method to execute when the user want to disable the add-on.
Now that I am thinking bout it, I find it slightly frightening that when you disable add-on, there is not a huge message stating that you need to restart. I guess it’s not clear to every user, and it may be quite confusing why things don’t get disabled.
I do not see a reason to complicate more Anki code base just to have some addons loading/unloading dynamically. Why you cannot just restart Anki after downloading/uninstalling an addon?
Anki is not anki heavy program which takes several minutes to open/close. I mean, this usually does not happens unless you have auto-backup turned on and your collection is big and takes several minutes to backup and Anki runs a backup when you open/close it. For this backup problem, I think a more proper solution would be to have an option to exit Anki without running the auto-backup (also forcing it to not run the auto backup when it does open for the next time only). Then, users with big collections could enable this and restart Anki without being afraid to being stuck with a big backup operation running.
Anki is a study program (to study/review things). It is not supposed to be a program where a daily task of its users should be install and uninstall addons.
I agree that this is something Anki is missing and a pull request adding this should be welcome.
A lot of people remained on Anki 2.0 because 2.1 is slow on windows.
And that is not the main problem with restarting: it closes all windows. When adding card one pay want to avoid closing everything. In particular if you have plenty of browser and “add card” window open. I know for a fact that I am not the only one wanting to keep my windows, as I was hired for an add on which keeps windows open during sync.
I do agree that if an add on need to be regularly deactivated,it should be a feature of the add on, done by shortcut, config or GUI instead of dealing with enabling/disabling. I only added this part because it seemed to make sens and be similar. The download part is the only one important to the user I am
I am not sure if plug-and-play add-ons are really worth the time. Sure, they would be a quite interesting concept, but couldn’t they also introduce a lot of bugs? (I am new to Anki development/Python, so I have no idea actually)
Please note that I do not want to dismiss your idea, but personally, I do not see much gain - perhaps because I do not really understand the concept yet.
Personally, I would be more interested to have an option to quickly restart Anki, preferably with a kind of “Add-on profile” enabled (for binary testing, doing tasks which only need a certain set of add-ons from time to time, add-on incompatibilities). However, this is probably a feature which would rather fit into an add-on.
This feature would be disabled by default and enabled only if the add on dev request it. So I don’t expect it to create any bug for current add-on’s.
Of course, if a dev enable it and don’t take care, they care create bug. However it would be the case with every single feature. As the proverb state, the only safe gear is the one which is not used.
Please note that I expect to be a really small change in Anki. There really is nothing complex here.
Dealing with update may be more complex (but a cool feature too).
I’d be happy to discuss your other idea, but I’d prefer a distinct thread for it
Some add-ons want to deliberately place themselves at the start or the end of the load order to avoid conflicts, and this change could potentially break this. It also means we have to add an extra option for users who want to vet the code before running it. With so many other things going on at the moment, I’m afraid I think it’s best to keep this as it is for now.
Hey Arthur, I’m really sorry if this isn’t the proper way to reach out, but I don’t know how else to reach out to you. I’m looking to hire a developer for an Anki add on and I was hoping you’d be available.
Hope you are doing well. I am reaching out to see if it would be possible to hire you for creating an add-on I had in mind. Please let me know how we can proceed from here.
Sorry for the delay in the answer.
I rarely consult this forum anymore, I’ve less available time. I quit freelancing for a full time job as software engineer.
I can redirect you to my housemate, who also knows anki and is a freelancer if you’re interested. Epiphanie.gedeon@gmail.com