[F] Fix ranking reindex

pull/88/head
Azalea 2024-11-21 12:34:59 -05:00
parent b7360c426b
commit 27664164fa
2 changed files with 4 additions and 4 deletions

View File

@ -83,9 +83,9 @@ abstract class GameApiController<T : IUserData>(val name: String, userDataClass:
// Read from cache if we just computed it less than duration ago
// Shadow-ban: Do not show banned cards in the ranking except for the user who owns the card
return rankingCache.r.filter { !it.l || it.r.username == reqUser?.username }.map { it.r }.also {
logger.info("Ranking computed in ${millis() - time}ms")
}
return rankingCache.r.filter { !it.l || it.r.username == reqUser?.username }
.mapIndexed { i, it -> it.r.apply { rank = i + 1 } }
.also { logger.info("Ranking computed in ${millis() - time}ms") }
}
@API("playlog")

View File

@ -51,7 +51,7 @@ data class GenericGameSummary(
)
data class GenericRankingPlayer(
val rank: Int,
var rank: Int,
val name: String,
val username: String?,
val accuracy: Double,