define a vod gallery

This commit is contained in:
deflax 2024-01-19 04:24:14 +02:00
parent 2d7c4fd97c
commit 9e6b431091
3 changed files with 29 additions and 1 deletions

View file

@ -350,5 +350,13 @@ def video_watch_route(file_name_no_extension):
video_url=f'https://{scheduler_hostname}/video/{file_name}' video_url=f'https://{scheduler_hostname}/video/{file_name}'
return render_template('watch.html', video_url=video_url) return render_template('watch.html', video_url=video_url)
# Gallery
@app.route("/gallery", methods=['GET'])
def gallery_route():
# Get a list of video files and thumbnails
video_files = [file for file in os.listdir(f'{rec_path}/vod/') if file.endswith(('.mp4', '.mkv', '.avi'))]
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=thumbnails)
def create_app(): def create_app():
return app return app

View file

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DeflaxTV Video Gallery</title>
</head>
<body>
<h1>Video Gallery</h1>
<div>
{% for thumbnail in thumbnails %}
<a href="{{ url_for('video', filename=thumbnail[:-4]) }}">
<img src="{{ url_for('thumb', filename=thumbnail) }}" alt="Thumbnail">
</a>
{% endfor %}
</div>
</body>
</html>

View file

@ -20,7 +20,7 @@
max-width: 1920px; max-width: 1920px;
} }
</style> </style>
<title>DeflaxTV VoD Player</title> <title>DeflaxTV Video Player</title>
</head> </head>
<body> <body>