aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-18 17:51:27 +0000
committermat <github@matdoes.dev>2022-05-18 17:51:27 +0000
commitd6516b5b5d8ecce0b872c87ce6dff65b42abe694 (patch)
tree00b5ac1e7220c5d5a73748e15fd89dc0ee2a6d20 /src
parentbdfd50bd56a2441a4a2421f8163423d3091ca4e9 (diff)
downloadskyblock-api-d6516b5b5d8ecce0b872c87ce6dff65b42abe694.tar.gz
skyblock-api-d6516b5b5d8ecce0b872c87ce6dff65b42abe694.tar.bz2
skyblock-api-d6516b5b5d8ecce0b872c87ce6dff65b42abe694.zip
better auction sorting
Diffstat (limited to 'src')
-rw-r--r--src/database.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/database.ts b/src/database.ts
index e31794a..2cbab72 100644
--- a/src/database.ts
+++ b/src/database.ts
@@ -1138,7 +1138,8 @@ function toItemAuctionsSchemaBson(i: ItemAuctionsSchema): ItemAuctionsSchemaBson
id: createUuid(a.id)
}
}),
- oldestDate: i.auctions[0]?.ts ?? 0
+ // we sort by oldestDate to get the volume sold, but we don't want brand new items with like no data having a high frequency
+ oldestDate: i.auctions.length > 10 ? i.auctions[0]?.ts ?? 0 : 0
}
}