openplanet-nl / tmio

Issue tracker for Trackmania.io.
https://trackmania.io/
3 stars 0 forks source link

Leaderboardposition in Campaign Overview #68

Open Platyyyy opened 1 year ago

Platyyyy commented 1 year ago

Hello,

would it be possible to add your Leaderboard Position in the Overview of a Campaign as a little QOL change? Maybe directly under the Personal Best time?

image

Thanks!

davidbmaier commented 1 year ago

As mentioned on Discord, I think this would require a separate request for each map in a campaign to get the position via the score/surround API - obviously that could be cached but it doesn't really scale well since the cache would be per user (and users would expect it to be up to date when opening the page).

But maybe I'm missing some way to achieve this - @codecat you got an idea by any chance?

codecat commented 1 year ago

Yeah I agree, I don't really know of any good way to do it. If we did a request for every map & every player, Nadeo will complain at us pretty quickly :P

Platyyyy commented 1 year ago

I don't know how this works in the background, but the information is already there when you are on the leaderboard of a map. Isn't it possible to somehow "copy" that over to the overview?

I'm probably thinking too simple image

davidbmaier commented 1 year ago

It's available there because it's requested by the page during load - but that's always one map at a time. If we have to request 25 different maps every time someone just looks at a campaign, it increases the server load quite a bit.

Platyyyy commented 1 year ago

Ooh, ok ok, that makes sense. Thanks for explaining