diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index 60c7e0f1..cc60f311 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -298,7 +298,7 @@ def changedetection_app(config=None, datastore_o=None): # Sort by last_changed and add the uuid which is usually the key.. sorted_watches = [] - # @todo needs a .itemsWithTag() or something + # @todo needs a .itemsWithTag() or something - then we can use that in Jinaj2 and throw this away for uuid, watch in datastore.data['watching'].items(): if limit_tag != None: @@ -403,8 +403,6 @@ def changedetection_app(config=None, datastore_o=None): watch['uuid'] = uuid sorted_watches.append(watch) - sorted_watches.sort(key=lambda x: x['last_changed'], reverse=True) - existing_tags = datastore.get_all_tags() form = forms.quickWatchForm(request.form) diff --git a/changedetectionio/fetch_site_status.py b/changedetectionio/fetch_site_status.py index b5eef3ab..2ddf5ca3 100644 --- a/changedetectionio/fetch_site_status.py +++ b/changedetectionio/fetch_site_status.py @@ -255,9 +255,6 @@ class perform_site_check(): # Looks like something changed, but did it match all the rules? if blocked: changed_detected = False - else: - update_obj["last_changed"] = timestamp - # Extract title as title if is_html: diff --git a/changedetectionio/store.py b/changedetectionio/store.py index fca06438..d506aa92 100644 --- a/changedetectionio/store.py +++ b/changedetectionio/store.py @@ -518,3 +518,11 @@ class ChangeDetectionStore: # But we should set it back to a empty dict so we don't break if this schema runs on an earlier version. # In the distant future we can remove this entirely self.data['watching'][uuid]['history'] = {} + + # We incorrectly stored last_changed when there was not a change, and then confused the output list table + def update_3(self): + for uuid, watch in self.data['watching'].items(): + # Be sure it's recalculated + p = watch.history + if watch.history_n < 2: + watch['last_changed'] = 0 diff --git a/changedetectionio/templates/watch-overview.html b/changedetectionio/templates/watch-overview.html index b247fc7a..17b14904 100644 --- a/changedetectionio/templates/watch-overview.html +++ b/changedetectionio/templates/watch-overview.html @@ -40,7 +40,7 @@
- {% for watch in watches %} + {% for watch in watches|sort(attribute='last_changed', reverse=True) %}