From 63e91a3d669b7b666e8fccc14974eb7c9275a88d Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 5 Apr 2022 20:26:56 +0200 Subject: [PATCH] Skip processing a watch into the RSS feed if there's not enough data to examine (fixes Internal Server Error when accessing the RSS feed) (#521) --- changedetectionio/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index 542c2fa5..52aa491c 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -303,6 +303,10 @@ def changedetection_app(config=None, datastore_o=None): for watch in sorted_watches: dates = list(watch['history'].keys()) + # Re #521 - Don't bother processing this one if theres less than 2 snapshots, means we never had a change detected. + if len(dates) < 2: + continue + # Convert to int, sort and back to str again # @todo replace datastore getter that does this automatically dates = [int(i) for i in dates] @@ -316,7 +320,6 @@ def changedetection_app(config=None, datastore_o=None): guid = "{}/{}".format(watch['uuid'], watch['last_changed']) fe = fg.add_entry() - # Include a link to the diff page, they will have to login here to see if password protection is enabled. # Description is the page you watch, link takes you to the diff JS UI page base_url = datastore.data['settings']['application']['base_url']