Add thumb exists check

This commit is contained in:
ABelliqueux 2022-11-24 20:19:27 +01:00
parent 4af1885757
commit f9191892cf
1 changed files with 2 additions and 2 deletions

4
app.py
View File

@ -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__':