From 4c53859a4fab591a23b1c8b752d6b89e2c4ad9ee Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Wed, 25 Jan 2023 17:49:45 +0100 Subject: [PATCH] Fix UI state to show the correct fetch mode Added hook update to be sure the default is really set --- changedetectionio/__init__.py | 1 + changedetectionio/store.py | 10 ++++++++++ changedetectionio/templates/watch-overview.html | 7 ++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index 771abfa41..44489d0c6 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -417,6 +417,7 @@ def changedetection_app(config=None, datastore_o=None): has_unviewed=datastore.has_unviewed, hosted_sticky=os.getenv("SALTED_PASS", False) == False, queued_uuids=[q_uuid.item['uuid'] for q_uuid in update_q.queue], + system_default_fetcher=datastore.data['settings']['application'].get('fetch_backend'), tags=existing_tags, watches=sorted_watches ) diff --git a/changedetectionio/store.py b/changedetectionio/store.py index 2d1904024..820b5422f 100644 --- a/changedetectionio/store.py +++ b/changedetectionio/store.py @@ -673,3 +673,13 @@ class ChangeDetectionStore: self.data['settings']['application']['notification_urls'][i] = re.sub(r, r'{{\1}}', url) return + + # Some setups may have missed the correct default, so it shows the wrong config in the UI, although it will default to system-wide + def update_10(self): + for uuid, watch in self.data['watching'].items(): + try: + if not watch.get('fetch_backend', ''): + watch['fetch_backend'] = 'system' + except: + continue + return diff --git a/changedetectionio/templates/watch-overview.html b/changedetectionio/templates/watch-overview.html index d5f987d47..60a75b772 100644 --- a/changedetectionio/templates/watch-overview.html +++ b/changedetectionio/templates/watch-overview.html @@ -91,7 +91,12 @@ - {%if watch.get_fetch_backend == "html_webdriver" %}{% endif %} + {% if watch.get_fetch_backend == "html_webdriver" + or ( watch.get_fetch_backend == "system" and system_default_fetcher == 'html_webdriver' ) + %} + + {% endif %} + {%if watch.is_pdf %}{% endif %} {% if watch.last_error is defined and watch.last_error != False %}
{{ watch.last_error }}