aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/database.ts9
-rw-r--r--src/index.ts2
2 files changed, 9 insertions, 2 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
diff --git a/src/index.ts b/src/index.ts
index 460fec3..34f941b 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,4 +1,4 @@
-import { createSession, fetchAccountFromDiscord, fetchAllLeaderboardsCategorized, fetchLeaderboard, fetchMemberLeaderboardSpots, fetchSession, finishedCachingRawLeaderboards, leaderboardUpdateMemberQueue, leaderboardUpdateProfileQueue, updateAccount, fetchServerStatus, deleteSession } from './database.js'
+import { createSession, fetchAccountFromDiscord, fetchAllLeaderboardsCategorized, fetchLeaderboard, fetchMemberLeaderboardSpots, fetchSession, finishedCachingRawLeaderboards, leaderboardUpdateMemberQueue, leaderboardUpdateProfileQueue, updateAccount, deleteSession } from './database.js'
import { fetchElection, fetchItemList, fetchMemberProfile, fetchUser } from './hypixel.js'
import rateLimit from 'express-rate-limit'
import * as constants from './constants.js'