aboutsummaryrefslogtreecommitdiff
path: root/src/database.ts
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-20 22:54:05 -0500
committermat <github@matdoes.dev>2022-05-20 22:54:05 -0500
commiteb13e07305169c0f19ee87e2516005eb5c0ef3c9 (patch)
tree79ce5d5b0af95d65881ef4bf231de34e5ac456c1 /src/database.ts
parent3d1506341d77e9271df9ec1091b4871d61544a67 (diff)
downloadskyblock-api-eb13e07305169c0f19ee87e2516005eb5c0ef3c9.tar.gz
skyblock-api-eb13e07305169c0f19ee87e2516005eb5c0ef3c9.tar.bz2
skyblock-api-eb13e07305169c0f19ee87e2516005eb5c0ef3c9.zip
fastest_target_practice stat & leaderboard
Diffstat (limited to 'src/database.ts')
-rw-r--r--src/database.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/database.ts b/src/database.ts
index 5ede904..0e0a4af 100644
--- a/src/database.ts
+++ b/src/database.ts
@@ -87,7 +87,7 @@ const leaderboardMax = 100
const reversedLeaderboards = [
'first_join', 'last_save',
'_best_time', '_best_time_2',
- 'fastest_coop_join'
+ 'fastest_coop_join', 'fastest_target_practice'
]
let client: MongoClient
@@ -324,6 +324,10 @@ function getMemberLeaderboardAttributes(member: CleanMember): StringNumber {
data.slowest_coop_join = member.coopInvitation.acceptedTimestamp - member.coopInvitation.invitedTimestamp
}
+ const fastestTargetPractice = member.stats.find(s => s.rawName === 'fastest_target_practice')?.value
+ if (fastestTargetPractice !== undefined)
+ data.fastest_target_practice = fastestTargetPractice
+
return data
}
@@ -433,6 +437,7 @@ export async function fetchAllMemberLeaderboardAttributes(): Promise<string[]> {
'top_1_leaderboards_count',
'fastest_coop_join',
'slowest_coop_join',
+ 'fastest_target_practice'
]
}