[+] Return card id in ranking

pull/17/head
Azalea 2024-03-01 00:45:57 -05:00
parent acf117e43b
commit 8acee1251f
1 changed files with 3 additions and 3 deletions

View File

@ -123,8 +123,8 @@ fun genericRanking(
} }
// TODO: pagination // TODO: pagination
val users = userDataRepo.findAll().sortedByDescending { it.playerRating } val players = userDataRepo.findAll().sortedByDescending { it.playerRating }
return users.filter { it.card != null }.mapIndexed { i, user -> return players.filter { it.card != null }.mapIndexed { i, user ->
val plays = userPlaylogRepo.findByUserCardExtId(user.card!!.extId) val plays = userPlaylogRepo.findByUserCardExtId(user.card!!.extId)
GenericRankingPlayer( GenericRankingPlayer(
@ -135,7 +135,7 @@ fun genericRanking(
allPerfect = plays.count { it.isAllPerfect }, allPerfect = plays.count { it.isAllPerfect },
fullCombo = plays.count { it.isFullCombo }, fullCombo = plays.count { it.isFullCombo },
lastSeen = user.lastPlayDate.toString(), lastSeen = user.lastPlayDate.toString(),
username = user.card!!.aquaUser?.username ?: "" username = user.card!!.aquaUser?.username ?: "user${user.card!!.id}"
) )
}.also { rankingCache[cacheKey] = millis() to it } // Update the cache }.also { rankingCache[cacheKey] = millis() to it } // Update the cache
} }