Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon json config changes are not honored #91

Open
nyxkn opened this issue Nov 24, 2024 · 3 comments · May be fixed by #96
Open

Addon json config changes are not honored #91

nyxkn opened this issue Nov 24, 2024 · 3 comments · May be fixed by #96

Comments

@nyxkn
Copy link

nyxkn commented Nov 24, 2024

Editing the addon config json from Anki GUI does not work as intended (Tools -> Addons -> Config).

At a quick glance this might be because we're manually loading the config.json in ConfigManager, and manually saving to config_saved.json. But all of this bypasses the standard Anki behaviour of reading config files (https://github.com/ankitects/anki/blob/69ac450098518a39a1d955102a33c927281447d9/qt/aqt/addons.py#L706), where getConfig reads config.json but supplements it with meta.json, which is automatically updated when the user modifies the addon config from the GUI.

Maybe also related to #73

@kieranlblack
Copy link
Contributor

Apologies for the delayed response to this. Nice sleuthing work, I think your analysis of the issue is correct. Interestingly this looks intentional but there isn't much context as to why. See this commit jdlorimer/chinese-support-redux@a9dcaef

Since it looks like the original maintainers were trying to force people to redo their settings each time the addon upgraded, my guess is this was an attempt at allowing the maintainers at the time a way to make backwards-incompatible changes to the settings across versions of the addon without getting any weird behaviour.

Do you have any interest in fixing this? I would be happy to review a PR if you open one.

@nyxkn
Copy link
Author

nyxkn commented Dec 10, 2024

My idea would be to remove the code for custom config management and revert to standard anki behaviour. If that sounds acceptable then I'm happy to have a stab.

@kieranlblack
Copy link
Contributor

Sounds good, I think that is the right call here. Thank you for looking into it.

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

Successfully merging a pull request may close this issue.

2 participants