Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-val
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-val
Commits
4598e5ef
Commit
4598e5ef
authored
Feb 01, 2018
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace olx with local-storage on import
parent
47afc3f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
edxval/api.py
+9
-2
No files found.
edxval/api.py
View file @
4598e5ef
...
...
@@ -745,6 +745,10 @@ def copy_course_videos(source_course_id, destination_course_id):
)
EXPORTED_VIDEO_PREFIX
=
'olx'
IMPORTED_VIDEO_PREFIX
=
'local-video'
def
export_to_xml
(
video_ids
,
course_id
=
None
,
external
=
False
,
video_download_dir
=
None
,
resource_fs
=
None
):
"""
...
...
@@ -806,7 +810,7 @@ def export_to_xml(video_ids, course_id=None, external=False, video_download_dir=
resp
=
open
(
'/dev/null'
)
# skipping actually downloading for now because those are big files
with
resource_fs
.
open
(
exported_url
,
'wb'
)
as
f
:
f
.
write
(
resp
.
read
())
attributes
[
'url'
]
=
'
olx://{}'
.
format
(
exported_url
)
attributes
[
'url'
]
=
'
{}://{}'
.
format
(
EXPORTED_VIDEO_PREFIX
,
exported_url
)
SubElement
(
video_el
,
'encoded_video'
,
...
...
@@ -915,9 +919,12 @@ def import_from_xml(xml, edx_video_id, course_id=None):
profile_name
)
continue
url
=
encoded_video_el
.
get
(
'url'
)
if
url
.
startswith
(
EXPORTED_VIDEO_PREFIX
):
url
=
url
.
replace
(
EXPORTED_VIDEO_PREFIX
,
IMPORTED_VIDEO_PREFIX
)
data
[
'encoded_videos'
]
.
append
({
'profile'
:
profile_name
,
'url'
:
encoded_video_el
.
get
(
'url'
)
,
'url'
:
url
,
'file_size'
:
encoded_video_el
.
get
(
'file_size'
),
'bitrate'
:
encoded_video_el
.
get
(
'bitrate'
),
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment