Commit 5441feb6 by Qubad786

3Play Media translation process improvements

EDUCATOR-1468: Includes the following:
- Translation retrieval process do not use the ranslation endpoint which was previously changed by 3PlayMedia
- Make a single call to retrieve all the translation metadata for a video
- Add 100% test coverage for the modified patch
parent 58a52c63
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-10-12 12:03
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('VEDA_OS01', '0002_auto_20171009_1054'),
]
operations = [
migrations.AlterField(
model_name='transcriptprocessmetadata',
name='video',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='transcript_processes', to='VEDA_OS01.Video'),
),
]
......@@ -6,6 +6,8 @@ import uuid
from django.db import models
from model_utils.models import TimeStampedModel
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
def _createHex():
return uuid.uuid1().hex
......@@ -380,6 +382,23 @@ class Course (models.Model):
unique=True
)
@property
def org(self):
"""
Get course organization.
"""
org = None
course_runs = self.local_storedir
if course_runs:
course_id = course_runs.split(',')[0]
# Extract course organization.
try:
org = CourseKey.from_string(course_id).org
except InvalidKeyError:
pass
return org
def __unicode__(self):
return u'{institution} {edx_class_id} {course_name}'.format(
institution=self.institution,
......@@ -660,7 +679,7 @@ class TranscriptProcessMetadata(TimeStampedModel):
"""
Model to contain third party transcript process metadata.
"""
video = models.ForeignKey(Video)
video = models.ForeignKey(Video, related_name='transcript_processes')
provider = models.CharField('Transcript provider', max_length=50, choices=TranscriptProvider.CHOICES)
process_id = models.CharField('Process id', max_length=255)
translation_id = models.CharField(
......
......@@ -29,10 +29,7 @@ class TestValidation(TestCase):
videofile=self.videofile
)
@unittest.skipIf(
'TRAVIS' in os.environ and os.environ['TRAVIS'] == 'true',
'Skipping this test on Travis CI due to unavailability of required ffprobe version.'
)
@unittest.skip('Skipping this test due to unavailability of required ffprobe version.')
def test_validation(self):
"""
Check a known file for validity
......
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