diff options
Diffstat (limited to 'src/database.ts')
-rw-r--r-- | src/database.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/database.ts b/src/database.ts index 1f4c89a..7371fbf 100644 --- a/src/database.ts +++ b/src/database.ts @@ -441,6 +441,12 @@ export async function fetchMemberLeaderboard(name: string): Promise<MemberLeader const fetchLeaderboardPlayer = async (i: memberRawLeaderboardItem): Promise<MemberLeaderboardItem> => { const player = await cached.fetchBasicPlayer(i.uuid) + + if (player) { + // we don't need this in leaderboards + delete player.claimed + } + return { player, profileUuid: i.profile, @@ -538,6 +544,8 @@ export async function fetchMemberLeaderboardSpots(player: string, profile: strin }) } + memberLeaderboardSpots.sort((a, b) => a.positionIndex - b.positionIndex) + return memberLeaderboardSpots } @@ -808,7 +816,6 @@ async function removeBadMemberLeaderboardAttributes(): Promise<void> { await memberLeaderboardsCollection.deleteMany({ stats: {} }) await profileLeaderboardsCollection.deleteMany({ stats: {} }) - } export let finishedCachingRawLeaderboards = false |