Skip to content

Commit

Permalink
Do not fetch price history if price algorithm does not require it
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw committed Sep 22, 2024
1 parent 644bc1c commit fe2f6a8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions code.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit fe2f6a8

Please sign in to comment.