From 388f1ba3d5750a67143e61a0dcb062606a6eee9a Mon Sep 17 00:00:00 2001 From: Snakes Date: Fri, 9 Dec 2022 23:02:35 -0500 Subject: [PATCH] vid-thumbs: suppress ffmpeg stdout, fix vid toggle Previous behavior on submission_listing was clicking a thumbnail would toggle an inline video player. This was retained for clicking the thumbnail off the `.video-play` element; however, directly clicking the `.video-play` did not have the `toggleVideo` onclick event attached and would navigate the browser to the video file directly. --- files/assets/css/main.css | 1 + files/routes/posts.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/files/assets/css/main.css b/files/assets/css/main.css index e6d8fca31..8594ad775 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -5907,6 +5907,7 @@ g { background-color:var(--primary); padding:5px 5px 3px 7px; border-radius:.35rem; + pointer-events: none; } /* ------- Font Awesome ------- */ @font-face{ diff --git a/files/routes/posts.py b/files/routes/posts.py index f0b65a313..c9601b2e4 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -746,8 +746,9 @@ def submit_post(v:User, sub=None): elif file.content_type.startswith('video/'): post.url = process_video(file, v) name = f'/images/{time.time()}'.replace('.','') + '.webp' - # prints a lot of shit in console, pls fix snekdaddy - subprocess.run(['ffmpeg', '-i', post.url, '-vf', '"select=eq(n\,0)"', "-vf", "scale=100:-2", "-q:v", "3", "-frames:v", "1", name], check=True) + subprocess.run(['ffmpeg', '-y', '-loglevel', 'warning', + '-i', post.url, '-vf', '"select=eq(n\,0)"', '-vf', + 'scale=100:-2', '-q:v', '3', '-frames:v', '1', name], check=True) post.thumburl = name elif file.content_type.startswith('audio/'): post.url = process_audio(file, v)