aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cleaners/skyblock/stats.ts2
-rw-r--r--src/database.ts9
2 files changed, 8 insertions, 3 deletions
diff --git a/src/cleaners/skyblock/stats.ts b/src/cleaners/skyblock/stats.ts
index 708712a..0a0c32a 100644
--- a/src/cleaners/skyblock/stats.ts
+++ b/src/cleaners/skyblock/stats.ts
@@ -65,7 +65,7 @@ export function categorizeStat(statNameRaw: string): StatCategory {
}
export const statUnits = {
- time: ['_best_time', '_best_time_2'],
+ time: ['_best_time', '_best_time_2', 'fastest_coop_join'],
date: ['first_join', 'last_save'],
coins: ['purse'],
leaderboards: ['leaderboards_count', 'top_1_leaderboards_count']
diff --git a/src/database.ts b/src/database.ts
index 08413af..91f4116 100644
--- a/src/database.ts
+++ b/src/database.ts
@@ -74,7 +74,8 @@ export const cachedRawLeaderboards: Map<string, (memberRawLeaderboardItem | prof
const leaderboardMax = 100
const reversedLeaderboards = [
'first_join', 'last_save',
- '_best_time', '_best_time_2'
+ '_best_time', '_best_time_2',
+ 'fastest_coop_join'
]
let client: MongoClient
@@ -211,6 +212,9 @@ function getMemberLeaderboardAttributes(member: CleanMember): StringNumber {
if (member.lastSave)
data.last_save = member.lastSave
+ if (member.coopInvitation && member.coopInvitation.acceptedTimestamp && member.coopInvitation?.invitedBy?.uuid !== member.uuid)
+ data.fastest_coop_join = member.coopInvitation.acceptedTimestamp - member.coopInvitation.invitedTimestamp
+
return data
}
@@ -300,7 +304,8 @@ export async function fetchAllMemberLeaderboardAttributes(): Promise<string[]> {
'purse',
'visited_zones',
'leaderboards_count',
- 'top_1_leaderboards_count'
+ 'top_1_leaderboards_count',
+ 'fastest_coop_join'
]
}