From 10b1e870ec83b2e2bb3c01b11f4fae5ec77db69c Mon Sep 17 00:00:00 2001 From: deflax Date: Sun, 21 Jan 2024 04:28:54 +0200 Subject: [PATCH] show files instead of paths --- src/scheduler/scheduler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/scheduler/scheduler.py b/src/scheduler/scheduler.py index 4720686..dfa2942 100644 --- a/src/scheduler/scheduler.py +++ b/src/scheduler/scheduler.py @@ -366,7 +366,10 @@ def gallery_route(): # Get the full file paths thumbnail_paths = [os.path.join(thumbnails_path, file) for file in thumbnails] # Sort the file paths by modification time in reverse order - sorted_thumbnails = sorted(thumbnail_paths, key=lambda x: os.path.getmtime(x), reverse=True) + sorted_thumbnails_paths = sorted(thumbnail_paths, key=lambda x: os.path.getmtime(x), reverse=True) + + # Extract file names from sorted paths + sorted_thumbnails = [os.path.basename(file) for file in sorted_thumbnails_paths] thumbnails = [file for file in os.listdir(f'{rec_path}/thumb/') if file.endswith('.png')] return render_template('gallery.html', video_files=video_files, thumbnails=sorted_thumbnails)