diff --git a/changedetectionio/forms.py b/changedetectionio/forms.py index 19056b5d..cac42d6d 100644 --- a/changedetectionio/forms.py +++ b/changedetectionio/forms.py @@ -588,6 +588,8 @@ class globalSettingsApplicationForm(commonSettingsForm): global_ignore_text = StringListField('Ignore Text', [ValidateListRegex()]) global_subtractive_selectors = StringListField('Remove elements', [ValidateCSSJSONXPATHInput(allow_json=False)]) ignore_whitespace = BooleanField('Ignore whitespace') + keep_history_n = IntegerField('Number of snapshots to keep in history for each watch') + keep_history_seconds = IntegerField('Number of snapshots to keep - maximum age (todo/seconds)') password = SaltyPasswordField() pager_size = IntegerField('Pager size', render_kw={"style": "width: 5em;"}, diff --git a/changedetectionio/model/App.py b/changedetectionio/model/App.py index fdd627ed..21b72ce0 100644 --- a/changedetectionio/model/App.py +++ b/changedetectionio/model/App.py @@ -40,6 +40,8 @@ class model(dict): 'global_ignore_text': [], # List of text to ignore when calculating the comparison checksum 'global_subtractive_selectors': [], 'ignore_whitespace': True, + 'keep_history_n': None, # Number of snapshots to keep + 'keep_history_seconds': None, # Or time ago back to keep 'notification_body': default_notification_body, 'notification_format': default_notification_format, 'notification_title': default_notification_title, diff --git a/changedetectionio/model/Watch.py b/changedetectionio/model/Watch.py index a2e38ce1..85df935a 100644 --- a/changedetectionio/model/Watch.py +++ b/changedetectionio/model/Watch.py @@ -625,6 +625,9 @@ class model(watch_base): if index > 1 and os.path.isfile(filepath): os.remove(filepath) + def post_process(self): + + x=1 @property def get_browsersteps_available_screenshots(self): diff --git a/changedetectionio/model/__init__.py b/changedetectionio/model/__init__.py index 36d12384..a17d0dbc 100644 --- a/changedetectionio/model/__init__.py +++ b/changedetectionio/model/__init__.py @@ -33,6 +33,8 @@ class watch_base(dict): 'headers': {}, # Extra headers to send 'ignore_text': [], # List of text to ignore when calculating the comparison checksum 'in_stock_only': True, # Only trigger change on going to instock from out-of-stock + 'keep_history_n': None, # Number of snapshots to keep + 'keep_history_seconds': None, # Or time ago back to keep 'include_filters': [], 'last_checked': 0, 'last_error': False, diff --git a/changedetectionio/templates/settings.html b/changedetectionio/templates/settings.html index e39c4081..c9eb03d1 100644 --- a/changedetectionio/templates/settings.html +++ b/changedetectionio/templates/settings.html @@ -129,6 +129,13 @@ Note: Simply changing the User-Agent often does not defeat anti-robot technologies, it's important to consider all of the ways that the browser is detected. +