Commit 7b68cf9f authored by Andreas Valder's avatar Andreas Valder
Browse files

another try

parent d5c2ce55
......@@ -2,12 +2,12 @@ from server import *
def livestream_thumbnail():
livestreams = query('''SELECT streams.handle AS livehandle, streams.lecture_id, "formats" AS sep, formats.*
livestreams = query('''SELECT streams.lecture_id
FROM streams
JOIN lectures ON = streams.lecture_id
JOIN formats ON formats.keywords = "hls"
WHERE AND (? OR streams.visible)
''', ismod())
for v in genlive(livestreams):
sorter.schedule_thumbnail(v['lecture_id'], v['path'])
......@@ -35,7 +35,7 @@ def insert_video(lectureid,dbfilepath,filepath,fileformatid):
query('INSERT INTO sortlog (lecture_id,video_id,path,`when`) VALUES (?,?,?,?)', lectureid, video_id, dbfilepath,
def schedule_thumbnail(lectureid):
def schedule_thumbnail(lectureid, filePath=None):
videos = query('''
SELECT videos.path
FROM videos
......@@ -44,6 +44,8 @@ def schedule_thumbnail(lectureid):
ORDER BY formats.prio DESC''', lectureid )
if videos:
path = videos[0]['path']
elif filePath:
path = filePath
data = '{"lectureid": "'+str(lectureid)+'", "path": "'+path+'"}'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment