ig3 / anki-limitnew

Limit the number of new cards in Anki
MIT License
3 stars 0 forks source link

Uninstalling the add-on does not revert back to real new-cards/day #8

Closed Uldyssian57 closed 3 years ago

Uldyssian57 commented 3 years ago

If you try to play around with the settings of the add-on and then uninstall it, you may not be able to get any new cards that day. I can't add any new-cards for the day except by increasing the new card limit in the custom study options.

Edit: I just read through the other issues, and it might have something to do with new cards being set to 0 again for some reason. I could get back to my real new-cards/day by reloading a backup (File -> Switch Profile -> Change User -> Load from backup). Doing so reverted the new cards to normal.

Edit2: Closing and reopening Anki in-between each modification of the deck/add-on options seems to fix the issue. Great add-on by the way!

ig3 commented 3 years ago

Yes, uninstalling the add-on will not allow new cards up to new cards per day. The reason is that the add-on (like custom study) doesn't change the new card limit. Rather, it changes Anki's count of new cards already studied on the day. Any changes to this are persistent across Anki restarts and disabling or uninstalling the add-on will not change the count.

Using custom study to add some more new cards does exactly what the add-on does, except in the opposite direction. To limit new cards, the add-on increases the count of new cards studied to be closer to the daily limit. To allow more new cards, custom study decreases the count of new cards so that it is further from the daily limit. I would rather (as in the older version) adjust the limit, leaving an accurate count of new cards studied, but Anki doesn't have API for that any more.

Restarting Anki causes the add-on to re-initialize and there are a few calculations that are done only at initialization and when the day rolls over. I guess I should change it to also do those when configuration has changed. In the meantime, a restart might be required, depending on what changed.