Skip to content

Commit

Permalink
Merge pull request #230 from xPaw/no-price-history
Browse files Browse the repository at this point in the history
Do not fetch price history if price algorithm does not require it
  • Loading branch information
Nuklon authored Sep 25, 2024
2 parents 754c5e8 + fe2f6a8 commit 184fd21
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 184fd21

Please sign in to comment.