From 96671eaaa92d2f0b508589a0cd372618d94c7fad Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 2 Jul 2022 15:26:52 -0500 Subject: don't store auction ids might be an even worse idea --- src/hypixel.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/hypixel.ts') diff --git a/src/hypixel.ts b/src/hypixel.ts index 70753f7..42a219d 100644 --- a/src/hypixel.ts +++ b/src/hypixel.ts @@ -401,13 +401,14 @@ export async function periodicallyFetchRecentlyEndedAuctions() { const simpleAuction: SimpleAuctionSchema = { s: true, coins: Math.round(auction.coins / auction.item.count), - id: auction.id, ts: Math.floor(auction.timestamp / 1000), bin: auction.bin, lore: auction.item.display.lore.join('\n') } // make sure the auction isn't already in there - if (!auctions.find((a) => a.id === simpleAuction.id)) { + // we use the timestamp because it's sorta unique enough + // (we don't store auction ids in the database because they're too big) + if (!auctions.find((a) => a.ts === simpleAuction.ts)) { auctions.push(simpleAuction) // keep only the last 100 items if (auctions.length > 100) -- cgit