Commit 388587c0 by Gregory Martin

fix ingest crash

parent b9996125
......@@ -40,6 +40,8 @@ import celeryapp
time_safetygap = datetime.datetime.utcnow().replace(tzinfo=utc) - timedelta(days=1)
# TODO: make a checklist of these if e != 'mobile_high' and e != 'audio_mp3' and e != 'review' and e != 'hls':
class VedaHeal():
"""
......@@ -59,7 +61,7 @@ class VedaHeal():
self.video_query = kwargs.get('video_query', None)
self.freezing_bug = kwargs.get('freezing_bug', True)
self.val_status = None
self.retry_barrier_hours = 48
self.retry_barrier_hours = 24
def _READ_AUTH(self):
if self.auth_yaml is None:
......@@ -157,7 +159,7 @@ class VedaHeal():
check_list = []
if encode_list is not None:
for e in encode_list:
if e != 'mobile_high' and e != 'audio_mp3' and e != 'review':
if e != 'mobile_high' and e != 'audio_mp3' and e != 'review' and e != 'hls':
check_list.append(e)
if check_list is None or len(check_list) == 0:
......@@ -194,6 +196,7 @@ class VedaHeal():
course_object=video_object.inst_class,
)
E2.determine_encodes()
E2.encode_list.remove('hls')
if len(E2.encode_list) == len(encode_list) and len(encode_list) > 1:
"""
Mark File Corrupt, accounting for migrated URLs
......
......@@ -89,7 +89,7 @@ class Output(object):
"""
@staticmethod
def _seconds_from_string(duration):
if duration == 0:
if duration == 0 or duration is None:
return 0
hours = float(duration.split(':')[0])
minutes = float(duration.split(':')[1])
......
......@@ -193,6 +193,12 @@ class VALAPICall():
if not isinstance(self.video_proto.platform_course_url, list):
self.video_proto.platform_course_url = [self.video_proto.platform_course_url]
try:
self.video_object.video_orig_duration
except NameError:
self.video_object.video_orig_duration = 0
self.video_object.duration = 0.0
if not isinstance(self.video_proto.duration, float):
self.video_proto.duration = Output._seconds_from_string(
duration=self.video_object.video_orig_duration
......
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