diff --git a/datasources/historical-prices.mjs b/datasources/historical-prices.mjs index 1aed5569..f5ab7a2c 100644 --- a/datasources/historical-prices.mjs +++ b/datasources/historical-prices.mjs @@ -26,18 +26,16 @@ class historicalPricesAPI extends WorkerKVSplit { let prices = cache.historicalPricePoint[itemId]; if (!prices) { return []; - } - else if (days === this.maxDays) { + } + /*if (days === this.maxDays) { return prices; + }*/ + const cutoffTimestamp = new Date().setDate(new Date().getDate() - days); + let dayFiltered = prices.filter(hp => hp.timestamp >= cutoffTimestamp); + if (halfResults) { + dayFiltered = dayFiltered.filter((hp, index) => index % 2 === 0); } - else { - const cutoffTimestamp = new Date().setDate(new Date().getDate() - days); - let dayFiltered = prices.filter(hp => hp.timestamp >= cutoffTimestamp); - if (halfResults) { - dayFiltered = dayFiltered.filter((hp, index) => index % 2 === 0); - } - return dayFiltered; - } + return dayFiltered; } } diff --git a/schema-static.mjs b/schema-static.mjs index 255162bb..cffb6cf8 100644 --- a/schema-static.mjs +++ b/schema-static.mjs @@ -1042,6 +1042,8 @@ type Task { minPlayerLevel: Int taskRequirements: [TaskStatusRequirement]! traderRequirements: [RequirementTrader]! + availableDelaySecondsMin: Int + availableDelaySecondsMax: Int objectives: [TaskObjective]! startRewards: TaskRewards finishRewards: TaskRewards