Unverified Commit ba772119 by Sofiya Semenova Committed by GitHub

Merge pull request #109 from edx/sofiya/mp3

Add 'no_audio' optional flag to HEAL command
parents 1f45cdd0 8083abc4
...@@ -57,7 +57,8 @@ def main(): ...@@ -57,7 +57,8 @@ def main():
{cmd} -c course_id {cmd} -c course_id
{cmd} -s schedule {cmd} -s schedule
{cmd} --process-translations {cmd} --process-translations
[-i -c -s --process-translations] {cmd} --no_audio
[-i -c -s --process-translations --no_audio]
Use --help to see all options. Use --help to see all options.
'''.format(cmd=sys.argv[0]) '''.format(cmd=sys.argv[0])
...@@ -84,6 +85,12 @@ def main(): ...@@ -84,6 +85,12 @@ def main():
action='store_true' action='store_true'
) )
parser.add_argument(
'--no_audio',
help='Removes audio_mp3 from encode list.',
action='store_true'
)
args = parser.parse_args() args = parser.parse_args()
veda_id = args.veda_id veda_id = args.veda_id
...@@ -118,7 +125,8 @@ def main(): ...@@ -118,7 +125,8 @@ def main():
VH = VedaHeal( VH = VedaHeal(
video_query=Video.objects.filter( video_query=Video.objects.filter(
edx_id=veda_id.strip() edx_id=veda_id.strip()
) ),
no_audio=args.no_audio
) )
VH.send_encodes() VH.send_encodes()
return return
...@@ -130,7 +138,8 @@ def main(): ...@@ -130,7 +138,8 @@ def main():
institution=course_id[0:3], institution=course_id[0:3],
edx_classid=course_id[3:8] edx_classid=course_id[3:8]
) )
) ),
no_audio=args.no_audio
) )
VH.send_encodes() VH.send_encodes()
return return
......
...@@ -45,6 +45,7 @@ class VedaHeal(object): ...@@ -45,6 +45,7 @@ class VedaHeal(object):
self.freezing_bug = kwargs.get('freezing_bug', False) self.freezing_bug = kwargs.get('freezing_bug', False)
self.val_status = None self.val_status = None
self.retry_barrier_hours = 24 self.retry_barrier_hours = 24
self.no_audio = kwargs.get('no_audio', False)
def discovery(self): def discovery(self):
self.video_query = Video.objects.filter( self.video_query = Video.objects.filter(
...@@ -157,6 +158,8 @@ class VedaHeal(object): ...@@ -157,6 +158,8 @@ class VedaHeal(object):
).determine_encodes() ).determine_encodes()
try: try:
if uncompleted_encodes: if uncompleted_encodes:
if self.no_audio and 'audio_mp3' in uncompleted_encodes:
uncompleted_encodes.remove('audio_mp3')
uncompleted_encodes.remove('review') uncompleted_encodes.remove('review')
except KeyError: except KeyError:
pass pass
......
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