Fix thumbs gen

This commit is contained in:
ABelliqueux 2022-12-14 17:04:44 +01:00
parent 3334fd1d14
commit feeecc44fd
1 changed files with 2 additions and 1 deletions

3
app.py
View File

@ -172,7 +172,8 @@ def list_media_files(folder):
def generate_thumbnails(): def generate_thumbnails():
media_files = list_media_files(upload_folder) media_files = list_media_files(upload_folder)
for media in media_files: for media in media_files:
subprocess.call(['ffmpeg', '-i', os.path.join(upload_folder, media), '-q:v', '30', '-s', '160x120', '-vf', 'boxblur=2', '-ss', '00:00:01.000', '-vframes', '1', os.path.join(thumbnails_folder, media) + ".jpg", "-y"]) if not os.path.exists(os.path.join(thumbnails_folder, media["filename"]) + ".jpg"):
subprocess.call(['ffmpeg', '-i', os.path.join(upload_folder, media["filename"]), '-q:v', '30', '-s', '160x120', '-vf', 'boxblur=2', '-ss', '00:00:01.000', '-vframes', '1', os.path.join(thumbnails_folder, media["filename"]) + ".jpg", "-y"])
def value_in_dict_list(value, dict_list, key): def value_in_dict_list(value, dict_list, key):