diff options
author | mat <github@matdoes.dev> | 2022-03-27 17:59:12 -0500 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-03-27 17:59:12 -0500 |
commit | 8e17029d648d9f7aa285f8a35581cf28444caaa6 (patch) | |
tree | 3c617f5fb33906fd8e12563b8162f51295fb7b04 | |
parent | a789330d340b55c0f4e00ea33045b32d84ee4d35 (diff) | |
download | skyblock-api-8e17029d648d9f7aa285f8a35581cf28444caaa6.tar.gz skyblock-api-8e17029d648d9f7aa285f8a35581cf28444caaa6.tar.bz2 skyblock-api-8e17029d648d9f7aa285f8a35581cf28444caaa6.zip |
Add harp leaderboards
-rw-r--r-- | src/cleaners/skyblock/stats.ts | 1 | ||||
-rw-r--r-- | src/database.ts | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/cleaners/skyblock/stats.ts b/src/cleaners/skyblock/stats.ts index 645f879..44ca1c4 100644 --- a/src/cleaners/skyblock/stats.ts +++ b/src/cleaners/skyblock/stats.ts @@ -12,6 +12,7 @@ const statCategories: { [key: string]: string[] | null } = { // sorted in order 'collection': ['collection_'], 'skills': ['skill_'], 'slayer': ['slayer_'], + 'harp': ['harp_'], 'misc': null // everything else goes here } diff --git a/src/database.ts b/src/database.ts index a822112..887facb 100644 --- a/src/database.ts +++ b/src/database.ts @@ -172,6 +172,17 @@ function getMemberSlayerAttributes(member: CleanMember): StringNumber { return slayerAttributes } +function getMemberHarpAttributes(member: CleanMember): StringNumber { + const harpAttributes: StringNumber = {} + + for (const song of member.harp.songs) { + harpAttributes[`harp_${song.completions}_completions`] = song.completions + harpAttributes[`harp_${song.perfectCompletions}_perfect_completions`] = song.perfectCompletions + } + + return harpAttributes +} + function getMemberLeaderboardAttributes(member: CleanMember): StringNumber { // if you want to add a new leaderboard for member attributes, add it here (and getAllLeaderboardAttributes) return { @@ -187,6 +198,9 @@ function getMemberLeaderboardAttributes(member: CleanMember): StringNumber { // slayer leaderboards ...getMemberSlayerAttributes(member), + // harp leaderboards + ...getMemberHarpAttributes(member), + fairy_souls: member.fairySouls.total, first_join: member.firstJoin, purse: member.purse, |