Commit e30b4bf1 by Tyler Hallada

Remove alt_location and overwrite url instead

parent 1f446702
...@@ -59,7 +59,6 @@ def create_video(video_data): ...@@ -59,7 +59,6 @@ def create_video(video_data):
client_video_id: client ID of video client_video_id: client ID of video
encoded_video: a list of EncodedVideo dicts encoded_video: a list of EncodedVideo dicts
url: url of the video url: url of the video
alt_location: domain agnostic location of the video
file_size: size of the video in bytes file_size: size of the video in bytes
profile: ID of the profile profile: ID of the profile
courses: Courses associated with this video courses: Courses associated with this video
...@@ -95,7 +94,6 @@ def update_video(video_data): ...@@ -95,7 +94,6 @@ def update_video(video_data):
client_video_id: client ID of video client_video_id: client ID of video
encoded_video: a list of EncodedVideo dicts encoded_video: a list of EncodedVideo dicts
url: url of the video url: url of the video
alt_location: domain agnostic location of the video
file_size: size of the video in bytes file_size: size of the video in bytes
profile: ID of the profile profile: ID of the profile
courses: Courses associated with this video courses: Courses associated with this video
...@@ -492,7 +490,6 @@ def get_video_info(edx_video_id): ...@@ -492,7 +490,6 @@ def get_video_info(edx_video_id):
client_video_id: client ID of video client_video_id: client ID of video
encoded_video: a list of EncodedVideo dicts encoded_video: a list of EncodedVideo dicts
url: url of the video url: url of the video
alt_location:
file_size: size of the video in bytes file_size: size of the video in bytes
profile: ID of the profile profile: ID of the profile
} }
...@@ -513,7 +510,6 @@ def get_video_info(edx_video_id): ...@@ -513,7 +510,6 @@ def get_video_info(edx_video_id):
'encoded_videos': [ 'encoded_videos': [
{ {
'url': u'http://www.example.com/name-of-video.mp4', 'url': u'http://www.example.com/name-of-video.mp4',
'alt_location': u'name-of-video.mp4',
'file_size': 25556, 'file_size': 25556,
'bitrate': 9600, 'bitrate': 9600,
'profile': u'mobile' 'profile': u'mobile'
...@@ -655,7 +651,6 @@ def get_video_info_for_course_and_profiles(course_id, profiles): ...@@ -655,7 +651,6 @@ def get_video_info_for_course_and_profiles(course_id, profiles):
'profiles': { 'profiles': {
profile_name: { profile_name: {
'url': url of the encoding 'url': url of the encoding
'alt_location': domain agnostic location of the encoding
'file_size': size of the file in bytes 'file_size': size of the file in bytes
}, },
} }
...@@ -669,12 +664,10 @@ def get_video_info_for_course_and_profiles(course_id, profiles): ...@@ -669,12 +664,10 @@ def get_video_info_for_course_and_profiles(course_id, profiles):
u'profiles': { u'profiles': {
u'mobile': { u'mobile': {
'url': u'http: //www.example.com/meow', 'url': u'http: //www.example.com/meow',
'alt_location': u'meow',
'file_size': 2222 'file_size': 2222
}, },
u'desktop': { u'desktop': {
'url': u'http: //www.example.com/woof', 'url': u'http: //www.example.com/woof',
'alt_location': u'woof',
'file_size': 4444 'file_size': 4444
} }
} }
...@@ -684,12 +677,10 @@ def get_video_info_for_course_and_profiles(course_id, profiles): ...@@ -684,12 +677,10 @@ def get_video_info_for_course_and_profiles(course_id, profiles):
u'profiles': { u'profiles': {
u'mobile': { u'mobile': {
'url': u'http: //www.example.com/roar', 'url': u'http: //www.example.com/roar',
'alt_location': u'roar',
'file_size': 6666 'file_size': 6666
}, },
u'desktop': { u'desktop': {
'url': u'http: //www.example.com/bzzz', 'url': u'http: //www.example.com/bzzz',
'alt_location': u'bzzz',
'file_size': 8888 'file_size': 8888
} }
} }
...@@ -811,12 +802,12 @@ def export_to_xml(video_ids, course_id=None, external=False, video_download_dir= ...@@ -811,12 +802,12 @@ def export_to_xml(video_ids, course_id=None, external=False, video_download_dir=
} }
if video_download_dir and resource_fs and unicode(encoded_video.profile) != u'youtube': if video_download_dir and resource_fs and unicode(encoded_video.profile) != u'youtube':
video_url = unicode(encoded_video.url) video_url = unicode(encoded_video.url)
exported_url = '{}/{}'.format(video_download_dir, video_url.split('/')[-1]) exported_url = 'olx://{}/{}'.format(video_download_dir, video_url.split('/')[-1])
# resp = urllib2.urlopen(video_url) # resp = urllib2.urlopen(video_url)
resp = open('/dev/null') # skipping actually downloading for now because those are big files resp = open('/dev/null') # skipping actually downloading for now because those are big files
with resource_fs.open(exported_url, 'wb') as f: with resource_fs.open(exported_url, 'wb') as f:
f.write(resp.read()) f.write(resp.read())
attributes['alt_location'] = exported_url attributes['url'] = exported_url
SubElement( SubElement(
video_el, video_el,
'encoded_video', 'encoded_video',
......
...@@ -170,7 +170,6 @@ class EncodedVideo(models.Model): ...@@ -170,7 +170,6 @@ class EncodedVideo(models.Model):
created = models.DateTimeField(auto_now_add=True) created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True) modified = models.DateTimeField(auto_now=True)
url = models.CharField(max_length=200) url = models.CharField(max_length=200)
alt_location = models.CharField(max_length=200)
file_size = models.PositiveIntegerField() file_size = models.PositiveIntegerField()
bitrate = models.PositiveIntegerField() bitrate = models.PositiveIntegerField()
......
...@@ -38,7 +38,6 @@ class EncodedVideoSerializer(serializers.ModelSerializer): ...@@ -38,7 +38,6 @@ class EncodedVideoSerializer(serializers.ModelSerializer):
"created", "created",
"modified", "modified",
"url", "url",
"alt_location",
"file_size", "file_size",
"bitrate", "bitrate",
"profile", "profile",
......
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