anki-loadbalancer
anki-loadbalancer copied to clipboard
Small bug regarding maximum interval
I have encountered a small issue when using your plugin, and wanted to report it. The basic issue is, when your plugin searches for the day with the least load to place a card in, it does not avoid days that are beyond the maximum interval of the deck. As a resault, if a card is scheduled to close to the maximum interval, the plugin tries to place it beyond the maximum (since the days beyond the maximum have 0 load), but anki does not allow it and sets it to exactly the maximum interval instead (I have confirmed using your debug feature that this is indeed the issue). This is especially an issue when reviewing after a long break, as it can cause a large number of cards to clamp in a single day (the maximum interval). I have been able to personally fix the issue by adding the following lines of code
revc=conf["rev"]
deckmaxivl=revc["maxIvl"] if "maxIvl" in revc else 0xFFFFFFFF
ivlmax=min(ivlmax,deckmaxivl)
immidietly after this section of your code (lines 46-49)
ivlmin = idealIvl - min(qc["LBMaxBefore"], int(idealIvl*qc["LBPercentBefore"]))
ivlmax = idealIvl + min(qc["LBMaxAfter"], int(idealIvl*qc["LBPercentAfter"]))
ivlmin = max(min(ivlmin, idealIvl-qc["LBMinBefore"]), 1)
ivlmax = max(ivlmax, idealIvl+qc["LBMinAfter"])
Thank you for the consideration and for creating such an amazing plugin.