From fba2b1a39d369b20b0ea2ae6ad1f9532113004a0 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Wed, 15 Jun 2022 15:05:52 +0200 Subject: [PATCH] Notifications regression bug in 0.39.15 - only sent the first notification URL --- README.md | 4 ++-- changedetectionio/__init__.py | 1 + changedetectionio/notification.py | 12 ++++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f5656415..02cea91c 100644 --- a/README.md +++ b/README.md @@ -56,9 +56,9 @@ Easily see what changed, examine by word, line, or individual character. Please :star: star :star: this project and help it grow! https://github.com/dgtlmoon/changedetection.io/ -### Target elements with the Visual Selector tool. +### Filter by elements using the Visual Selector tool. -Available when connected to a playwright content fetcher (available also as part of our subscription service) +Available when connected to a playwright content fetcher (included as part of our subscription service) Self-hosted web page change monitoring context difference diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index 5b6ff262..60c7e0f1 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -1263,6 +1263,7 @@ def notification_runner(): else: now = datetime.now() + sent_obj = None try: from changedetectionio import notification diff --git a/changedetectionio/notification.py b/changedetectionio/notification.py index ac510a8b..59c1f556 100644 --- a/changedetectionio/notification.py +++ b/changedetectionio/notification.py @@ -48,6 +48,7 @@ def process_notification(n_object, datastore): # Anything higher than or equal to WARNING (which covers things like Connection errors) # raise it as an exception apobjs=[] + sent_objs=[] for url in n_object['notification_urls']: apobj = apprise.Apprise(debug=True) @@ -101,11 +102,14 @@ def process_notification(n_object, datastore): log_value = logs.getvalue() if log_value and 'WARNING' in log_value or 'ERROR' in log_value: raise Exception(log_value) + + sent_objs.append({'title': n_title, + 'body': n_body, + 'url' : url, + 'body_format': n_format}) - # Return what was sent for better logging - return {'title': n_title, - 'body': n_body, - 'body_format': n_format} + # Return what was sent for better logging - after the for loop + return sent_objs # Notification title + body content parameters get created here.