|
|
@ -74,7 +74,6 @@ app.config['TEMPLATES_AUTO_RELOAD'] = True
|
|
|
|
app.jinja_env.add_extension('jinja2.ext.loopcontrols')
|
|
|
|
app.jinja_env.add_extension('jinja2.ext.loopcontrols')
|
|
|
|
csrf = CSRFProtect()
|
|
|
|
csrf = CSRFProtect()
|
|
|
|
csrf.init_app(app)
|
|
|
|
csrf.init_app(app)
|
|
|
|
|
|
|
|
|
|
|
|
notification_debug_log=[]
|
|
|
|
notification_debug_log=[]
|
|
|
|
|
|
|
|
|
|
|
|
watch_api = Api(app, decorators=[csrf.exempt])
|
|
|
|
watch_api = Api(app, decorators=[csrf.exempt])
|
|
|
@ -586,6 +585,7 @@ def changedetection_app(config=None, datastore_o=None):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if request.method == 'POST' and form.validate():
|
|
|
|
if request.method == 'POST' and form.validate():
|
|
|
|
|
|
|
|
|
|
|
|
extra_update_obj = {}
|
|
|
|
extra_update_obj = {}
|
|
|
|
|
|
|
|
|
|
|
|
if request.args.get('unpause_on_save'):
|
|
|
|
if request.args.get('unpause_on_save'):
|
|
|
@ -1133,7 +1133,8 @@ def changedetection_app(config=None, datastore_o=None):
|
|
|
|
form = forms.quickWatchForm(request.form)
|
|
|
|
form = forms.quickWatchForm(request.form)
|
|
|
|
|
|
|
|
|
|
|
|
if not form.validate():
|
|
|
|
if not form.validate():
|
|
|
|
flash("Error")
|
|
|
|
for widget, l in form.errors.items():
|
|
|
|
|
|
|
|
flash(','.join(l), 'error')
|
|
|
|
return redirect(url_for('index'))
|
|
|
|
return redirect(url_for('index'))
|
|
|
|
|
|
|
|
|
|
|
|
url = request.form.get('url').strip()
|
|
|
|
url = request.form.get('url').strip()
|
|
|
@ -1144,15 +1145,14 @@ def changedetection_app(config=None, datastore_o=None):
|
|
|
|
add_paused = request.form.get('edit_and_watch_submit_button') != None
|
|
|
|
add_paused = request.form.get('edit_and_watch_submit_button') != None
|
|
|
|
new_uuid = datastore.add_watch(url=url, tag=request.form.get('tag').strip(), extras={'paused': add_paused})
|
|
|
|
new_uuid = datastore.add_watch(url=url, tag=request.form.get('tag').strip(), extras={'paused': add_paused})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if new_uuid:
|
|
|
|
if not add_paused and new_uuid:
|
|
|
|
if add_paused:
|
|
|
|
# Straight into the queue.
|
|
|
|
flash('Watch added in Paused state, saving will unpause.')
|
|
|
|
update_q.put(queuedWatchMetaData.PrioritizedItem(priority=1, item={'uuid': new_uuid}))
|
|
|
|
return redirect(url_for('edit_page', uuid=new_uuid, unpause_on_save=1))
|
|
|
|
flash("Watch added.")
|
|
|
|
else:
|
|
|
|
|
|
|
|
# Straight into the queue.
|
|
|
|
if add_paused:
|
|
|
|
update_q.put(queuedWatchMetaData.PrioritizedItem(priority=1, item={'uuid': new_uuid}))
|
|
|
|
flash('Watch added in Paused state, saving will unpause.')
|
|
|
|
flash("Watch added.")
|
|
|
|
return redirect(url_for('edit_page', uuid=new_uuid, unpause_on_save=1))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return redirect(url_for('index'))
|
|
|
|
return redirect(url_for('index'))
|
|
|
|
|
|
|
|
|
|
|
@ -1184,8 +1184,9 @@ def changedetection_app(config=None, datastore_o=None):
|
|
|
|
uuid = list(datastore.data['watching'].keys()).pop()
|
|
|
|
uuid = list(datastore.data['watching'].keys()).pop()
|
|
|
|
|
|
|
|
|
|
|
|
new_uuid = datastore.clone(uuid)
|
|
|
|
new_uuid = datastore.clone(uuid)
|
|
|
|
update_q.put(queuedWatchMetaData.PrioritizedItem(priority=5, item={'uuid': new_uuid, 'skip_when_checksum_same': True}))
|
|
|
|
if new_uuid:
|
|
|
|
flash('Cloned.')
|
|
|
|
update_q.put(queuedWatchMetaData.PrioritizedItem(priority=5, item={'uuid': new_uuid, 'skip_when_checksum_same': True}))
|
|
|
|
|
|
|
|
flash('Cloned.')
|
|
|
|
|
|
|
|
|
|
|
|
return redirect(url_for('index'))
|
|
|
|
return redirect(url_for('index'))
|
|
|
|
|
|
|
|
|
|
|
|