From a01b395a8695300108077703f2296a804dc4e1ec Mon Sep 17 00:00:00 2001 From: Razzmatazz Date: Fri, 11 Oct 2024 15:13:31 -0500 Subject: [PATCH 1/2] filter historical prices date range --- datasources/historical-prices.mjs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) 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; } } From 78daf7ba2ccfef399ef4345d7c09921b050bd5af Mon Sep 17 00:00:00 2001 From: Razzmatazz Date: Sat, 12 Oct 2024 21:53:03 -0500 Subject: [PATCH 2/2] add task available delays --- schema-static.mjs | 2 ++ 1 file changed, 2 insertions(+) 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