From 47803f95a305026029317d669140c8d8b7978e6c Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Mon, 1 Jan 2024 16:31:32 +0100 Subject: [PATCH] "In stock" should be 'none' by default --- changedetectionio/model/Watch.py | 1 + changedetectionio/store.py | 1 + changedetectionio/templates/watch-overview.html | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changedetectionio/model/Watch.py b/changedetectionio/model/Watch.py index a4774efc..f785c815 100644 --- a/changedetectionio/model/Watch.py +++ b/changedetectionio/model/Watch.py @@ -38,6 +38,7 @@ base_config = { 'track_ldjson_price_data': None, 'headers': {}, # Extra headers to send 'ignore_text': [], # List of text to ignore when calculating the comparison checksum + 'in_stock' : None, 'in_stock_only' : True, # Only trigger change on going to instock from out-of-stock 'include_filters': [], 'last_checked': 0, diff --git a/changedetectionio/store.py b/changedetectionio/store.py index be2546e4..d4214184 100644 --- a/changedetectionio/store.py +++ b/changedetectionio/store.py @@ -248,6 +248,7 @@ class ChangeDetectionStore: 'check_count': 0, 'fetch_time' : 0.0, 'has_ldjson_price_data': None, + 'in_stock': None, 'last_checked': 0, 'last_error': False, 'last_notification_error': False, diff --git a/changedetectionio/templates/watch-overview.html b/changedetectionio/templates/watch-overview.html index 9b3e9b64..f6643df5 100644 --- a/changedetectionio/templates/watch-overview.html +++ b/changedetectionio/templates/watch-overview.html @@ -141,7 +141,7 @@ {% if watch['processor'] == 'restock_diff' %} - {% if watch['last_checked'] %} + {% if watch['last_checked'] and watch['in_stock'] != None %} {% if watch['in_stock'] %} In stock {% else %} Not in stock {% endif %} {% else %} Not yet checked