diff --git a/changedetectionio/processors/restock_diff/__init__.py b/changedetectionio/processors/restock_diff/__init__.py
index 3c48eec9..785668be 100644
--- a/changedetectionio/processors/restock_diff/__init__.py
+++ b/changedetectionio/processors/restock_diff/__init__.py
@@ -59,6 +59,10 @@ class Watch(BaseWatch):
super().__init__(*arg, **kw)
self['restock'] = Restock(kw['default']['restock']) if kw.get('default') and kw['default'].get('restock') else Restock()
+ self['restock_settings'] = kw['default']['restock_settings'] if kw.get('default',{}).get('restock_settings') else {
+ 'follow_price_changes': True
+ }
+
def clear_watch(self):
super().clear_watch()
self.update({'restock': Restock()})
diff --git a/changedetectionio/processors/restock_diff/forms.py b/changedetectionio/processors/restock_diff/forms.py
index 92e5d31c..6ee45220 100644
--- a/changedetectionio/processors/restock_diff/forms.py
+++ b/changedetectionio/processors/restock_diff/forms.py
@@ -4,10 +4,12 @@ from wtforms import (
validators,
FloatField
)
+from wtforms.fields.form import FormField
+from wtforms.form import Form
from changedetectionio.forms import processor_text_json_diff_form
-
-class processor_settings_form(processor_text_json_diff_form):
+class RestockSettingsForm(Form):
+# Could be both, "in_stock_only" either
in_stock_only = BooleanField('Only trigger when product goes BACK to in-stock', default=True)
price_change_min = FloatField('Minimum amount to trigger notification', [validators.Optional()],
render_kw={"placeholder": "No limit", "size": "10"})
@@ -19,7 +21,12 @@ class processor_settings_form(processor_text_json_diff_form):
validators.NumberRange(min=0, max=100, message="Should be between 0 and 100"),
], render_kw={"placeholder": "0%", "size": "5"})
- follow_price_changes = BooleanField('Follow price changes', default=False)
+ follow_price_changes = BooleanField('Follow price changes', default=True)
+
+class processor_settings_form(processor_text_json_diff_form):
+
+ restock_settings = FormField(RestockSettingsForm)
+
def extra_tab_content(self):
return 'Restock & Price Detection'
@@ -33,29 +40,28 @@ class processor_settings_form(processor_text_json_diff_form):
});
-