call prepare_download() to prepare a download

stable
neingeist 6 years ago
parent 4db9d9f333
commit 754f4037ca

@ -29,10 +29,14 @@ def download():
form.start_time.data = datetime.now() - timedelta(hours=1)
form.length.data = 60
elif form.validate_on_submit():
output_filename = prepare_download(form)
if output_filename:
flash('The download should start immediately.', 'success')
return render_template('download.html', form=form, filename='test.mp3')
return render_template('download.html', form=form, filename=output_filename)
else:
flash('Error', 'warning')
flash('Error preparing download!', 'warning')
else:
flash('Error in form!', 'warning')
return render_template('download.html', form=form)
@ -42,5 +46,9 @@ def download_file(filename):
as_attachment=True)
def prepare_download(form):
return 'test.mp3'
if __name__ == '__main__':
app.run(debug=True)

Loading…
Cancel
Save