From fe2f6a8ff914f3c22d346491d7a05ab7ce667100 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sun, 22 Sep 2024 21:28:32 +0300 Subject: [PATCH] Do not fetch price history if price algorithm does not require it --- code.user.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code.user.js b/code.user.js index 8db81b5..99e78d1 100644 --- a/code.user.js +++ b/code.user.js @@ -554,6 +554,13 @@ // Prices are ordered by oldest to most recent. // Price is inclusive of fees. SteamMarket.prototype.getPriceHistory = function(item, cache, callback) { + const shouldUseAverage = getSettingWithDefault(SETTING_PRICE_ALGORITHM) == 1; + + if (!shouldUseAverage) { + // The price history is only used by the "average price" calculation + return callback(ERROR_SUCCESS, null, true); + } + try { const market_name = getMarketHashName(item); if (market_name == null) {