UPDATE: Get All Vods

This commit is contained in:
EvanLin3141
2025-03-01 00:44:33 +00:00
parent edb959506a
commit 8fcba8a030
3 changed files with 19 additions and 0 deletions

View File

@@ -162,6 +162,17 @@ def vods(username):
vods = get_user_vods(user_id)
return jsonify(vods)
def get_all_vods():
"""
Returns data of all VODs by all streamers in a JSON-compatible format
"""
with Database() as db:
vods = db.fetchall("SELECT * FROM vods")
print("Fetched VODs from DB:", vods) # ✅ Debugging line
return jsonify(vods)
# RTMP Server Routes

Binary file not shown.

View File

@@ -84,6 +84,14 @@ def get_user_vods(user_id: int):
vods = db.fetchall("""SELECT * FROM vods WHERE user_id = ?;""", (user_id,))
return vods
def get_all_vods():
"""
Returns data of all VODs by all streamers in a JSON-compatible format
"""
with Database() as db:
vods = db.fetchall("""SELECT * FROM vods""")
return vods
def generate_thumbnail(stream_file: str, thumbnail_file: str, retry_time=5, retry_count=3) -> None:
"""
Generates the thumbnail of a stream