From 752ffe24a9d50ceed5aa40f967f706e3c0a11bf2 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Sun, 20 Nov 2022 09:58:14 +0100 Subject: [PATCH] Screenshot should only be available for playwright/webdriver --- changedetectionio/__init__.py | 8 +++++++- changedetectionio/templates/edit.html | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index 97db72cf..0215f12c 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -644,12 +644,18 @@ def changedetection_app(config=None, datastore_o=None): except ModuleNotFoundError: jq_support = False + watch = datastore.data['watching'].get(uuid) + system_uses_webdriver = datastore.data['settings']['application']['fetch_backend'] == 'html_webdriver' + is_html_webdriver = True if watch.get('fetch_backend') == 'html_webdriver' or ( + watch.get('fetch_backend', None) is None and system_uses_webdriver) else False + output = render_template("edit.html", current_base_url=datastore.data['settings']['application']['base_url'], emailprefix=os.getenv('NOTIFICATION_MAIL_BUTTON_PREFIX', False), form=form, has_default_notification_urls=True if len(datastore.data['settings']['application']['notification_urls']) else False, has_empty_checktime=using_default_check_time, + is_html_webdriver=is_html_webdriver, jq_support=jq_support, playwright_enabled=os.getenv('PLAYWRIGHT_DRIVER_URL', False), settings_application=datastore.data['settings']['application'], @@ -657,7 +663,7 @@ def changedetection_app(config=None, datastore_o=None): uuid=uuid, visualselector_data_is_ready=visualselector_data_is_ready, visualselector_enabled=visualselector_enabled, - watch=datastore.data['watching'][uuid], + watch=watch ) return output diff --git a/changedetectionio/templates/edit.html b/changedetectionio/templates/edit.html index 0f8e2ce1..3441f757 100644 --- a/changedetectionio/templates/edit.html +++ b/changedetectionio/templates/edit.html @@ -141,9 +141,11 @@ User-Agent: wonderbra 1.0") }}
{{ render_checkbox_field(form.notification_muted) }}
-
+ {% if is_html_webdriver %} +
{{ render_checkbox_field(form.notification_screenshot) }}
+ {% endif %}
{% if has_default_notification_urls %}