Commit 16b84d3f by Dave St.Germain

Fixed youtube id lookup (no longer storing youtube urls in db)

parent a3c54afe
...@@ -93,10 +93,9 @@ class Video(models.Model): ...@@ -93,10 +93,9 @@ class Video(models.Model):
""" """
Look up video by youtube id Look up video by youtube id
""" """
url = '://youtu.be/%s' % youtube_id
qset = cls.objects.filter( qset = cls.objects.filter(
encoded_videos__profile__profile_name='youtube', encoded_videos__profile__profile_name='youtube',
encoded_videos__url__endswith=url encoded_videos__url=youtube_id
).prefetch_related('encoded_videos', 'courses', 'subtitles') ).prefetch_related('encoded_videos', 'courses', 'subtitles')
return qset return qset
......
...@@ -516,7 +516,7 @@ class VideoListTest(APIAuthTestCase): ...@@ -516,7 +516,7 @@ class VideoListTest(APIAuthTestCase):
'encoded_videos': [ 'encoded_videos': [
{ {
'profile': 'youtube', 'profile': 'youtube',
'url': 'https://youtu.be/AbcDef', 'url': 'AbcDef',
'file_size': 4545, 'file_size': 4545,
'bitrate': 6767, 'bitrate': 6767,
} }
......
Markdown is supported
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