repair video list view

This commit is contained in:
kicap 2024-07-15 13:58:00 +08:00
parent 1f60d77958
commit d94deb8c9c
1 changed files with 3 additions and 3 deletions

6
app.py
View File

@ -403,7 +403,7 @@ async def generate_frames2(video, threshold,stat):
def update_video_list(): async def update_video_list():
global video_list global video_list
# add "video/" to the video_list and only take video extensions # 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")] 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') @app.route('/video_list')
async def video_list(): async def video_list():
update_video_list() await update_video_list()
return render_template('video_list.html', video_list=video_list) return await render_template('video_list.html', video_list=video_list)
@app.route('/videos/<path:video>') @app.route('/videos/<path:video>')
async def video(video): async def video(video):