Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-video-pipeline
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-video-pipeline
Commits
6ac35caf
Commit
6ac35caf
authored
Jan 03, 2018
by
muhammad-ammar
Committed by
Qubad786
Feb 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve val status update logic
EDUCATOR-2033
parent
b71d6d31
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
9 deletions
+48
-9
control/tests/test_deliver.py
+14
-0
control/veda_deliver.py
+34
-9
No files found.
control/tests/test_deliver.py
View file @
6ac35caf
...
...
@@ -23,6 +23,7 @@ class VedaDeliverRunTest(TestCase):
def
setUp
(
self
):
self
.
veda_id
=
'XXXXXXXX2014-V00TES1'
self
.
encode_profile
=
'hls'
self
.
encode_profile_mp4
=
'desktop_mp4'
self
.
course
=
Course
.
objects
.
create
(
institution
=
'XXX'
,
edx_classid
=
'XXXXX'
,
...
...
@@ -46,6 +47,13 @@ class VedaDeliverRunTest(TestCase):
product_spec
=
self
.
encode_profile
,
encode_filetype
=
'HLS'
)
self
.
encode_mp4
=
Encode
.
objects
.
create
(
encode_destination
=
self
.
destination
,
profile_active
=
True
,
encode_suffix
=
'DTH'
,
product_spec
=
self
.
encode_profile_mp4
,
encode_filetype
=
'mpeg-4'
)
self
.
deliver_instance
=
VedaDelivery
(
veda_id
=
self
.
veda_id
,
encode_profile
=
self
.
encode_profile
,
...
...
@@ -141,6 +149,12 @@ class VedaDeliverRunTest(TestCase):
videoID
=
self
.
video
,
encode_url
=
'Test_URL'
)
URL
.
objects
.
create
(
encode_profile
=
self
.
encode_mp4
,
videoID
=
self
.
video
,
encode_url
=
'Test_URL'
)
self
.
assertEqual
(
self
.
deliver_instance
.
_DETERMINE_STATUS
(),
'Complete'
)
def
test_validate_url
(
self
):
...
...
control/veda_deliver.py
View file @
6ac35caf
...
...
@@ -101,7 +101,9 @@ class VedaDelivery:
"""
if
self
.
encode_profile
==
'youtube'
:
self
.
_CLEANUP
()
self
.
start_transcription
(
self
.
_DETERMINE_STATUS
())
return
None
if
self
.
encode_profile
==
'review'
:
return
None
...
...
@@ -127,17 +129,34 @@ class VedaDelivery:
self
.
_UPDATE_DATA
()
self
.
_CLEANUP
()
# Transcription Process
# We only want to generate transcripts for `desktop_mp4` profile.
if
self
.
encode_profile
==
'desktop_mp4'
and
self
.
video_query
.
process_transcription
:
self
.
start_transcription
(
self
.
status
)
def
start_transcription
(
self
,
status
):
"""
Kick off the transcription process
Arguments:
status (str): `Complete` or `Progress`
"""
# We only want to generate transcripts when all encodings are completed
if
status
==
'Complete'
and
self
.
video_query
.
process_transcription
:
encode_query
=
Encode
.
objects
.
get
(
product_spec
=
'desktop_mp4'
)
encoded_file
=
'
%
s_
%
s.
%
s'
%
(
self
.
veda_id
,
encode_query
.
encode_suffix
,
encode_query
.
encode_filetype
)
# 3PlayMedia
if
self
.
video_query
.
provider
==
TranscriptProvider
.
THREE_PLAY
:
self
.
start_3play_transcription_process
()
self
.
start_3play_transcription_process
(
encoded_file
)
# Cielo24
if
self
.
video_query
.
provider
==
TranscriptProvider
.
CIELO24
:
self
.
cielo24_transcription_flow
()
self
.
cielo24_transcription_flow
(
encoded_file
)
def
hls_run
(
self
):
"""
...
...
@@ -500,9 +519,12 @@ class VedaDelivery:
os
.
chdir
(
homedir
)
return
True
def
cielo24_transcription_flow
(
self
):
def
cielo24_transcription_flow
(
self
,
encoded_file
):
"""
Cielo24 transcription flow.
Arguments:
encoded_file (str): name of encoded file to construct video url
"""
org
=
extract_course_org
(
self
.
video_proto
.
platform_course_url
[
0
])
...
...
@@ -515,7 +537,7 @@ class VedaDelivery:
s3_video_url
=
build_url
(
self
.
auth_dict
[
's3_base_url'
],
self
.
auth_dict
[
'edx_s3_endpoint_bucket'
],
self
.
encoded_file
encoded_file
)
callback_base_url
=
build_url
(
...
...
@@ -547,9 +569,12 @@ class VedaDelivery:
)
cielo24
.
start_transcription_flow
()
def
start_3play_transcription_process
(
self
):
def
start_3play_transcription_process
(
self
,
encoded_file
):
"""
3PlayMedia Transcription Flow
Arguments:
encoded_file (str): name of encoded file to construct video url
"""
try
:
# Picks the first course from the list as there may be multiple
...
...
@@ -569,7 +594,7 @@ class VedaDelivery:
s3_video_url
=
build_url
(
self
.
auth_dict
[
's3_base_url'
],
self
.
auth_dict
[
'edx_s3_endpoint_bucket'
],
self
.
encoded_file
encoded_file
)
callback_url
=
build_url
(
self
.
auth_dict
[
'veda_base_url'
],
...
...
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