Exemplo n.º 1
0
def player(vid_pk):
    vid = db.getVideo(vid_pk)
    youtube_video = 'youtube.com' in vid['url']

    if youtube_video:
        params = urlparse.urlparse(vid['url'])[4]
        match = re.match(r"(?P<yt_id>v=(\d|\w)*)", params)
        vid['url'] = match.group('yt_id')[2:]

    notes = db.getNotes(vid_pk, getUser())
    sorted_notes = utils.sortNotes(notes)
    return view('player.html',
                video=vid,
                youtube_video=youtube_video,
                notes=sorted_notes)
Exemplo n.º 2
0
 def test_getVideoByPk(self):
     result = db.getVideo(1)
     assert True
Exemplo n.º 3
0
 def test_getVideoByPk(self):
     result = db.getVideo(1)
     assert True