From e4eaa0c8176b67e9bd7bb53f7cefdf5ff1b7999d Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Thu, 21 Apr 2022 12:52:45 +0200 Subject: [PATCH] Shows which items are already in the queue, disables adding to the queue if already in the recheck queue (#552) --- changedetectionio/__init__.py | 6 ++++-- changedetectionio/templates/watch-overview.html | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index 4f58fdcb..aa9c810b 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -342,6 +342,8 @@ def changedetection_app(config=None, datastore_o=None): @app.route("/", methods=['GET']) @login_required def index(): + from changedetectionio import forms + limit_tag = request.args.get('tag') pause_uuid = request.args.get('pause') @@ -378,7 +380,6 @@ def changedetection_app(config=None, datastore_o=None): existing_tags = datastore.get_all_tags() - from changedetectionio import forms form = forms.quickWatchForm(request.form) output = render_template("watch-overview.html", @@ -390,7 +391,8 @@ def changedetection_app(config=None, datastore_o=None): has_unviewed=datastore.data['has_unviewed'], # Don't link to hosting when we're on the hosting environment hosted_sticky=os.getenv("SALTED_PASS", False) == False, - guid=datastore.data['app_guid']) + guid=datastore.data['app_guid'], + queued_uuids=update_q.queue) return output diff --git a/changedetectionio/templates/watch-overview.html b/changedetectionio/templates/watch-overview.html index 5bf725a7..02bb20fb 100644 --- a/changedetectionio/templates/watch-overview.html +++ b/changedetectionio/templates/watch-overview.html @@ -46,7 +46,8 @@ {% if watch.last_error is defined and watch.last_error != False %}error{% endif %} {% if watch.last_notification_error is defined and watch.last_notification_error != False %}error{% endif %} {% if watch.paused is defined and watch.paused != False %}paused{% endif %} - {% if watch.newest_history_key| int > watch.last_viewed| int %}unviewed{% endif %}"> + {% if watch.newest_history_key| int > watch.last_viewed| int %}unviewed{% endif %} + {% if watch.uuid in queued_uuids %}queued{% endif %}"> {{ loop.index }} Pause @@ -72,8 +73,8 @@ {% endif %} - Recheck + {% if watch.uuid in queued_uuids %}Queued{% else %}Recheck{% endif %} Edit {% if watch.history|length >= 2 %} Diff