Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Video AG Infrastruktur
website
Commits
1ee9236b
Commit
1ee9236b
authored
7 years ago
by
Andreas Valder
Browse files
Options
Downloads
Patches
Plain Diff
added thumbnails for livestreams, closes
#251
parent
621f4936
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
livestreams.py
+22
-0
22 additions, 0 deletions
livestreams.py
server.py
+2
-7
2 additions, 7 deletions
server.py
sorter.py
+0
-1
0 additions, 1 deletion
sorter.py
with
24 additions
and
8 deletions
livestreams.py
0 → 100644
+
22
−
0
View file @
1ee9236b
from
server
import
*
from
sorter
import
schedule_thumbnail
def
genlive
(
streams
):
for
stream
in
streams
:
stream
[
'
visible
'
]
=
True
stream
[
'
downloadable
'
]
=
False
stream
[
'
path
'
]
=
'
pub/hls/%s.m3u8
'
%
stream
[
'
livehandle
'
]
stream
[
'
file_size
'
]
=
0
return
streams
@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
):
schedule_thumbnail
(
v
.
lecture_id
)
This diff is collapsed.
Click to expand it.
server.py
+
2
−
7
View file @
1ee9236b
...
...
@@ -381,13 +381,7 @@ def courses():
groupedby
=
'
semester
'
return
render_template
(
'
courses.html
'
,
courses
=
courses
,
groupedby
=
groupedby
)
def
genlive
(
streams
):
for
stream
in
streams
:
stream
[
'
visible
'
]
=
True
stream
[
'
downloadable
'
]
=
False
stream
[
'
path
'
]
=
'
pub/hls/%s.m3u8
'
%
stream
[
'
livehandle
'
]
stream
[
'
file_size
'
]
=
0
return
streams
from
livestreams
import
genlive
@app.route
(
'
/<handle>
'
)
@app.route
(
'
/<int:id>
'
)
...
...
@@ -692,3 +686,4 @@ if 'JOBS_API_KEY' in config:
import
timetable
import
chapters
import
icalexport
import
livestreams
This diff is collapsed.
Click to expand it.
sorter.py
+
0
−
1
View file @
1ee9236b
...
...
@@ -36,7 +36,6 @@ def insert_video(lectureid,dbfilepath,filepath,fileformatid):
schedule_thumbnail
(
lectureid
)
def
schedule_thumbnail
(
lectureid
):
path
=
query
(
'
SELECT path FROM videos WHERE lecture_id
'
)
videos
=
query
(
'''
SELECT videos.path
FROM videos
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment