Add thumb exists check
This commit is contained in:
parent
4af1885757
commit
f9191892cf
4
app.py
4
app.py
|
@ -239,8 +239,8 @@ def upload_file(over_write=1):
|
||||||
@app.route("/thumb/<media>")
|
@app.route("/thumb/<media>")
|
||||||
@auth.login_required
|
@auth.login_required
|
||||||
def get_thumbnail(media):
|
def get_thumbnail(media):
|
||||||
if media:
|
if media and os.path.exists(thumbnails_folder + os.sep + media):
|
||||||
return send_file( thumbnails_folder + os.sep + media + ".jpg", mimetype='image/jpg')
|
return send_file(thumbnails_folder + os.sep + media + ".jpg", mimetype='image/jpg')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue