From d2e9fcd259d918c74265eb608c6186aafe37222d Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Mon, 1 Mar 2021 20:40:25 -0600 Subject: fix leaderboards being purged for reverse leaderboards --- src/database.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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, -- cgit