From 28e498d05b056cc2fbe34311fba8364a0d84ae0b Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Mon, 7 Oct 2024 17:43:16 +0200 Subject: [PATCH] Cleanup logix --- changedetectionio/processors/restock_diff/processor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/changedetectionio/processors/restock_diff/processor.py b/changedetectionio/processors/restock_diff/processor.py index e1d1604303d..3f38c41b755 100644 --- a/changedetectionio/processors/restock_diff/processor.py +++ b/changedetectionio/processors/restock_diff/processor.py @@ -239,11 +239,11 @@ def run_changedetection(self, watch, skip_when_checksum_same=True): # Very often websites will lie about the 'availability' in the metadata, so if the scraped version says its NOT in stock, use that. if self.fetcher.instock_data != 'None' and self.fetcher.instock_data != 'Possibly in stock': - if itemprop_availability.get('availability'): + if update_obj['restock'].get('in_stock'): logger.warning( f"Lie detected in the availability machine data!! when scraping said its not in stock!! itemprop was '{itemprop_availability}' and scraped from browser was '{self.fetcher.instock_data}' ") - logger.debug(f"Setting instock to FALSE, scraper found '{self.fetcher.instock_data}'") - update_obj['restock']["in_stock"] = False + logger.debug(f"Setting instock to FALSE, scraper found '{self.fetcher.instock_data}' in the body but metadata reported not-in-stock") + update_obj['restock']["in_stock"] = False # What we store in the snapshot price = update_obj.get('restock').get('price') if update_obj.get('restock').get('price') else ""