From d94deb8c9c9d079eba6cfb23d5d11fd02298953c Mon Sep 17 00:00:00 2001 From: kicap Date: Mon, 15 Jul 2024 13:58:00 +0800 Subject: [PATCH] repair video list view --- app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 0e27e4d..05936c9 100644 --- a/app.py +++ b/app.py @@ -403,7 +403,7 @@ async def generate_frames2(video, threshold,stat): -def update_video_list(): +async def update_video_list(): global video_list # add "video/" to the video_list and only take video extensions video_list = [f"video/{f}" for f in os.listdir("video") if f.endswith(".mp4")] @@ -459,8 +459,8 @@ async def video_feed(): @app.route('/video_list') async def video_list(): - update_video_list() - return render_template('video_list.html', video_list=video_list) + await update_video_list() + return await render_template('video_list.html', video_list=video_list) @app.route('/videos/') async def video(video):