From fd42f05ce3b849ed579787607bf5f77080aebb7f Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Mon, 20 May 2024 12:18:20 +0200 Subject: Fix: bazaar empty data (#1841) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../skyhanni/data/bazaar/HypixelBazaarFetcher.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/main/java/at') diff --git a/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt b/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt index 2cb70f857..cd9465264 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt @@ -62,6 +62,11 @@ object HypixelBazaarFetcher { val internalName = NEUItems.transHypixelNameToInternalName(key) val sellOfferPrice = product.buySummary.minOfOrNull { it.pricePerUnit } ?: 0.0 val insantBuyPrice = product.sellSummary.maxOfOrNull { it.pricePerUnit } ?: 0.0 + + if (product.quickStatus.isEmpty()) { + return@mapNotNull null + } + if (internalName.getItemStackOrNull() == null) { // Items that exist in Hypixel's Bazaar API, but not in NEU repo (not visible in in the ingame bazaar). // Should only include Enchants @@ -72,6 +77,17 @@ object HypixelBazaarFetcher { internalName to BazaarData(internalName.itemName, sellOfferPrice, insantBuyPrice, product) }.toMap() + private fun BazaarQuickStatus.isEmpty(): Boolean = with(this) { + sellPrice == 0.0 && + sellVolume == 0L && + sellMovingWeek == 0L && + sellOrders == 0L && + buyPrice == 0.0 && + buyVolume == 0L && + buyMovingWeek == 0L && + buyOrders == 0L + } + private fun onError(fetchType: String, e: Exception, rawResponse: String? = null) { val userMessage = "Failed fetching bazaar price data from hypixel" failedAttempts++ -- cgit