diff options
author | 2024-11-03 18:28:32 +0100 | |
---|---|---|
committer | 2024-11-03 18:28:32 +0100 | |
commit | bd0fb1da9901d0c91b1a68a8a50046a434440caf (patch) | |
tree | 721ec341775ac96e36b952123770dec583fedc55 | |
parent | 29d984cbe78bddd31fa97f810f1eebd0a46cbcb7 (diff) | |
download | rss-bridge-bd0fb1da9901d0c91b1a68a8a50046a434440caf.tar.gz rss-bridge-bd0fb1da9901d0c91b1a68a8a50046a434440caf.tar.zst rss-bridge-bd0fb1da9901d0c91b1a68a8a50046a434440caf.zip |
[IdealoBridge] Fix (#4316)
When a product was available before as used product in the past, and
now it's not available used anymore, a price update article was
generated on every feed loading, because the old used price was still
stored in the cache, and therefore different as "no price".
The issue was also present in the cas of a New product price that
becomes unavailable.
Now, when either there is no New or Used price available, the previous
price is delete from the cache.
-rw-r--r-- | bridges/IdealoBridge.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bridges/IdealoBridge.php b/bridges/IdealoBridge.php index f426a45c..7432f78a 100644 --- a/bridges/IdealoBridge.php +++ b/bridges/IdealoBridge.php @@ -152,14 +152,21 @@ class IdealoBridge extends BridgeAbstract $PriceNew = $FirstButton->find('strong', 0)->plaintext; // Save current price $this->saveCacheValue($KeyNEW, $PriceNew); + } else if ($FirstButton === null) { + // In case there is no actual New Price delete the previous value in the cache + $this->cache->delete($this->getShortName() . '_' . $KeyNEW); } + // Second Button contains the used product price $SecondButton = $html->find('.oopStage-conditionButton-wrapper-text', 1); if ($SecondButton) { $PriceUsed = $SecondButton->find('strong', 0)->plaintext; // Save current price $this->saveCacheValue($KeyUSED, $PriceUsed); + } else if ($SecondButton === null) { + // In case there is no actual Used Price delete the previous value in the cache + $this->cache->delete($this->getShortName() . '_' . $KeyUSED); } // Only continue if a price has changed |