Add-on to list all changes causing a full sync?

I have a bad habit of making changes to templates and forgetting to sync (and I prefer not to use the automatic sync setting). It occurred to me that I can write an add-on to list changes that are causing a full sync before that full sync is started. I think I can make this add-on myself using the existing hooks, but my naive approach feels very hacky: When a schema change happens, I need a place to store that change on disk because I may close Anki entirely. Afaict, the only way Anki allows for that is the add-on’s config.json file. Needless to say, this seems like a misuse of the config file since the changes are temporary.

I’m confident I could accumulate the schema changes as they build up using the existing hooks for adding/removing/repositioning the fields, templates, and models, but I don’t think I should be using the add-on config file to store these changes.

Will only answer this question.

FWIW, add-ons are just Python programs, so they can pretty much do anything Python programs can do, including writing files anywhere in the user’s disk (given necessary permissions). Anki doesn’t try to prevent add-ons from that.

The recommended place though to store add-on data is a special subfolder named “user_files”. See Add-on Config - Writing Anki Add-ons

1 Like