Commit 64aea6ff authored by Julian Rother's avatar Julian Rother
Browse files

Support for old legacy embed urls with video id

parent 939fc65a
......@@ -701,6 +701,14 @@ def legacy(phpfile=None):
if not courses:
return render_endpoint('index', 'Diese Seite existiert nicht!'), 404
return redirect(url_for('embed', course=courses[0]['handle'], id=request.args['lecture']),code=302)
if phpfile=='embed.php' and ('vid' in request.args):
lectures = query('SELECT lecture_id FROM videos WHERE id = ?', request.args['vid'])
if not lectures:
return render_endpoint('index', 'Dieses Videos existiert nicht!'), 404
courses = query('SELECT courses.handle FROM courses JOIN lectures ON courses.id = lectures.course_id WHERE lectures.id = ?', lectures[0]['lecture_id'])
if not courses:
return render_endpoint('index', 'Diese Seite existiert nicht!'), 404
return redirect(url_for('embed', course=courses[0]['handle'], id=lectures[0]['lecture_id']),code=302)
if phpfile=='feed.php' and ('all' in request.args):
return redirect(url_for('feed'),code=302)
if phpfile=='feed.php' and ('newcourses' in request.args):
......
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