Open dominiquelee opened 9 months ago
I had another look, thinking we could use a simple Image --> MatchTypeClass mapping, but it's actually not that easy:
@dominiquelee I sent a message to the CHPP staff, asking if this is how it will be going forward and if they have any suggestions. Worst case they'll tell me to go away, best case...
@dominiquelee I sent a message to the CHPP staff, asking if this is how it will be going forward and if they have any suggestions. Worst case they'll tell me to go away, best case...
What a waste of time that was. Basically, we do what we want, deal with it.
Short description of the problem
XP data fails to load when opening a player's performance history
Any other relevant information. Is it a regression, when it worked/broke etc.
Match type recognition comes from https://github.com/minj/foxtrick/blob/3780cd4dbfca20ba14997bbba6cf58456d2939ce/content/information-aggregation/player-stats-experience.js#L219-L223 which reads the class name of the icon of the line.
This value is then compared to module.XP: https://github.com/minj/foxtrick/blob/3780cd4dbfca20ba14997bbba6cf58456d2939ce/content/information-aggregation/player-stats-experience.js#L46-L52
However, the class name has changed and is now always
match-type-svg
A potential fix would be to extract the .svg URL, remove the version part and use that as a new key in the array. Some examples of value are
/Img/Svgs/match-types/series.svg?v=1
/Img/Svgs/match-types/cup.svg?v=1
/Img/Svgs/match-types/friendly.svg?v=1
/Img/Svgs/match-types/challenger-cup-2.svg?v=1
(Ruby Cup)/Img/Svgs/match-types/nt-worldcup.svg?v=1
(World Cup)/Img/Svgs/match-types/nt-cup-europe.svg?v=1
(Europe Cup)/Img/Svgs/match-types/masters.svg?v=1