Greasy Fork is available in English.

WKStats Levelup Fix

Fix weird issues with the levelups on wkstats that are assumed to be caused by new additions of kanji to levels

Skapare
Inserio
Dagliga installationer
0
Totala installationer
1
Betyg
0 0 0
Version
2.0.2
Skapad
2024-05-28
Uppdaterad
2024-05-28
Licens
MIT
Gäller för

Attempts to fix the calculations of the levelups by essentially overwriting the calc_levelups() function as soon as it finishes executing for the first time.

For some reason, the original calculation could result in some very funky situations, such as negative levelup lengths. My assumption is that a cause of this is the rearranging and adding of kanji to various levels. For example, if one kanji used to be in a later level but was moved to an earlier one and therefore causes the calculations to see your levelup date for that earlier level incorrectly as the date of passing the "later" kanji.

This is primarily only for edge-case scenarios, such as long-time users who don't have data for all of their levels in the APIv2 level_progressions endpoint.

If you want to see the calculations side-by-side (or rather, one after another), comment out or delete the following line:
wklogs['levelups'].length = 0;