diff options
author | mat <github@matdoes.dev> | 2022-05-18 17:51:27 +0000 |
---|---|---|
committer | mat <github@matdoes.dev> | 2022-05-18 17:51:27 +0000 |
commit | d6516b5b5d8ecce0b872c87ce6dff65b42abe694 (patch) | |
tree | 00b5ac1e7220c5d5a73748e15fd89dc0ee2a6d20 | |
parent | bdfd50bd56a2441a4a2421f8163423d3091ca4e9 (diff) | |
download | skyblock-api-d6516b5b5d8ecce0b872c87ce6dff65b42abe694.tar.gz skyblock-api-d6516b5b5d8ecce0b872c87ce6dff65b42abe694.tar.bz2 skyblock-api-d6516b5b5d8ecce0b872c87ce6dff65b42abe694.zip |
better auction sorting
-rw-r--r-- | src/database.ts | 3 |
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 } } |