diff options
author | mat <27899617+mat-1@users.noreply.github.com> | 2021-03-01 20:40:25 -0600 |
---|---|---|
committer | mat <27899617+mat-1@users.noreply.github.com> | 2021-03-01 20:40:25 -0600 |
commit | d2e9fcd259d918c74265eb608c6186aafe37222d (patch) | |
tree | c9ea98293327e7a002a3cdbbe60d7b4c1a985197 /src/database.ts | |
parent | c8075c866580909cf7a297655b4361a60b1187dc (diff) | |
download | skyblock-api-d2e9fcd259d918c74265eb608c6186aafe37222d.tar.gz skyblock-api-d2e9fcd259d918c74265eb608c6186aafe37222d.tar.bz2 skyblock-api-d2e9fcd259d918c74265eb608c6186aafe37222d.zip |
fix leaderboards being purged for reverse leaderboards
Diffstat (limited to 'src/database.ts')
-rw-r--r-- | src/database.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/database.ts b/src/database.ts index a4e401a..0ed8c7c 100644 --- a/src/database.ts +++ b/src/database.ts @@ -293,9 +293,11 @@ async function removeBadMemberLeaderboardAttributes() { unsetValue[leaderboard] = '' const filter = {} const requirement = await getMemberLeaderboardRequirement(leaderboard) + const leaderboardReversed = isLeaderboardReversed(leaderboard) if (requirement !== null) { filter[`stats.${leaderboard}`] = { - '$lt': requirement + '$lt': leaderboardReversed ? undefined : requirement, + '$gt': leaderboardReversed ? requirement : undefined } await memberLeaderboardsCollection.updateMany( filter, |