show files instead of paths

This commit is contained in:
deflax 2024-01-21 04:28:54 +02:00
parent a9985fe3ac
commit 10b1e870ec

View file

@ -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)