show files instead of paths
This commit is contained in:
parent
a9985fe3ac
commit
10b1e870ec
1 changed files with 4 additions and 1 deletions
|
@ -366,7 +366,10 @@ def gallery_route():
|
||||||
# Get the full file paths
|
# Get the full file paths
|
||||||
thumbnail_paths = [os.path.join(thumbnails_path, file) for file in thumbnails]
|
thumbnail_paths = [os.path.join(thumbnails_path, file) for file in thumbnails]
|
||||||
# Sort the file paths by modification time in reverse order
|
# 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')]
|
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)
|
return render_template('gallery.html', video_files=video_files, thumbnails=sorted_thumbnails)
|
||||||
|
|
Loading…
Reference in a new issue