passfail2 icon indicating copy to clipboard operation
passfail2 copied to clipboard

anki version detection function is invalid

Open domonnss opened this issue 5 months ago • 2 comments

The Anki name scheme has changed: https://github.com/ankitects/anki/pull/2640 I think the code regarding the Anki version should be updated. My programming skills are limited, and I need to prepare for an important exam soon. If no one maintains it, I'll submit a PR next spring.

domonnss avatar Jun 25 '25 08:06 domonnss

I don't currently have Anki set up on my machine and am busy with work for at least the upcoming week, but after that I may be able to take care of this. Should be a fix that only takes a couple of lines, another fallthrough for the imports.

Realistically may be worth breaking out all of the compatibility stuff that's currently just living at the top of passfail2.py to some sort of compat.py file though, as it's sure to only get more complex down the line.

lambdadog avatar Jun 25 '25 18:06 lambdadog

Can't promise to get to this soon yet, but I've taken a closer look and I think the right solution is definitely to create a "shim" for the Anki API that handles every different version I want to support and I import it instead of the normal hooks/translation functions/etc, rather than the import hell and inlining of version checks I'm currently using. This would mean simplifying the passfail2.py file drastically and moving all of the version logic to an ankilib.py file or something like that which passfail2.py imports, and that would be where version compatibility would be implemented/updated as future changes like this come down the pipeline.

I've been talking on and off recently about rearchitecting this addon from base principles soon and expect I'll be bundling this change in with that. Looking at the AnkiWeb addon portal it doesn't seem like anyone's bumped into any issues with this so far, which means this is isn't strictly urgent at this time, which is a relief, but it's definitely something that needs to be handled to keep the spaghetti at bay.

lambdadog avatar Oct 20 '25 02:10 lambdadog