diff --git a/changedetectionio/model/Watch.py b/changedetectionio/model/Watch.py index d4cf2b39..2bb7a400 100644 --- a/changedetectionio/model/Watch.py +++ b/changedetectionio/model/Watch.py @@ -45,6 +45,7 @@ base_config = { 'last_error': False, 'last_viewed': 0, # history key value of the last viewed via the [diff] link 'method': 'GET', + 'notification_alert_count': 0, # Custom notification content 'notification_body': None, 'notification_format': default_notification_format_for_watch, diff --git a/changedetectionio/templates/edit.html b/changedetectionio/templates/edit.html index 99679152..a5acd213 100644 --- a/changedetectionio/templates/edit.html +++ b/changedetectionio/templates/edit.html @@ -483,6 +483,10 @@ Unavailable") }} Last fetch time {{ watch.fetch_time }}s + + Notification alert count + {{ watch.notification_alert_count }} + diff --git a/changedetectionio/update_worker.py b/changedetectionio/update_worker.py index fee6a5a2..9d4be164 100644 --- a/changedetectionio/update_worker.py +++ b/changedetectionio/update_worker.py @@ -150,6 +150,10 @@ class update_worker(threading.Thread): queued = False if n_object and n_object.get('notification_urls'): queued = True + + count = watch.get('notification_alert_count', 0) + 1 + self.datastore.update_watch(uuid=watch_uuid, update_obj={'notification_alert_count': count}) + self.queue_notification_for_watch(notification_q=self.notification_q, n_object=n_object, watch=watch) return queued