aboutsummaryrefslogtreecommitdiff
path: root/build/database.js
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2021-08-01 20:05:34 -0500
committermat <github@matdoes.dev>2021-08-01 20:05:34 -0500
commit35ae0ef61d90004b3158a6e0dc1069a2170ac678 (patch)
tree20f2467b7680e9eb144de1bed54824183fd36f2b /build/database.js
parent3c60dd9cfd386e57e8445166ab41a92b77777f7e (diff)
downloadskyblock-api-35ae0ef61d90004b3158a6e0dc1069a2170ac678.tar.gz
skyblock-api-35ae0ef61d90004b3158a6e0dc1069a2170ac678.tar.bz2
skyblock-api-35ae0ef61d90004b3158a6e0dc1069a2170ac678.zip
remove debug message
Diffstat (limited to 'build/database.js')
-rw-r--r--build/database.js22
1 files changed, 5 insertions, 17 deletions
diff --git a/build/database.js b/build/database.js
index be001ff..8543901 100644
--- a/build/database.js
+++ b/build/database.js
@@ -371,28 +371,17 @@ async function fetchMemberLeaderboardSpots(player, profile) {
}
exports.fetchMemberLeaderboardSpots = fetchMemberLeaderboardSpots;
async function getLeaderboardRequirement(name, leaderboardType) {
- var _a, _b;
+ var _a, _b, _c, _d;
let leaderboard;
if (leaderboardType === 'member')
leaderboard = await fetchMemberLeaderboardRaw(name);
else if (leaderboardType === 'profile')
leaderboard = await fetchProfileLeaderboardRaw(name);
// if there's more than 100 items, return the 100th. if there's less, return null
- if (leaderboard.length >= leaderboardMax)
- return {
- top_100: leaderboard[leaderboardMax - 1].value,
- top_1: leaderboard[1].value
- };
- else if (leaderboard.length >= 1)
- return {
- top_100: null,
- top_1: (_b = (_a = leaderboard[1]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : null
- };
- else
- return {
- top_100: null,
- top_1: null
- };
+ return {
+ top_100: (_b = (_a = leaderboard[leaderboardMax - 1]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : null,
+ top_1: (_d = (_c = leaderboard[1]) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : null
+ };
}
/** Get the attributes for the member, but only ones that would put them on the top 100 for leaderboards */
async function getApplicableMemberLeaderboardAttributes(member) {
@@ -423,7 +412,6 @@ async function getApplicableMemberLeaderboardAttributes(member) {
if ((top1LeaderboardsCountRequirement.top_100 === null)
|| (top1LeaderboardsCount > top1LeaderboardsCountRequirement.top_100))
applicableAttributes['top_1_leaderboards_count'] = top1LeaderboardsCount;
- console.log('top_1_leaderboards_count', applicableTop1Attributes, top1LeaderboardsCount, 'requirement', top1LeaderboardsCountRequirement);
return applicableAttributes;
}
/** Get the attributes for the profile, but only ones that would put them on the top 100 for leaderboards */