livestreams.py 434 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
from server import *

@sched_func(30)
def livestream_thumbnail():
	livestreams = query('''SELECT streams.handle AS livehandle, streams.lecture_id, "formats" AS sep, formats.*
			FROM streams
			JOIN lectures ON lectures.id = streams.lecture_id
			JOIN formats ON formats.keywords = "hls"
			WHERE streams.active AND (? OR streams.visible)
			''', ismod())
	for v in genlive(livestreams):
12
		sorter.schedule_thumbnail(v['lecture_id'])
13