Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove subtitles code from VAL. #106

Merged
merged 2 commits into from
Oct 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions edxval/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ class TranscriptPreferenceAdmin(admin.ModelAdmin):


class ThirdPartyTranscriptCredentialsStateAdmin(admin.ModelAdmin):
list_display = ('org', 'provider', 'exists', 'created', 'modified')

model = ThirdPartyTranscriptCredentialsState
verbose_name = 'Organization Transcript Credential State'
verbose_name_plural = 'Organization Transcript Credentials State'
Expand Down
21 changes: 21 additions & 0 deletions edxval/migrations/0008_auto_20171026_0359.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('edxval', '0007_transcript_credentials_state'),
]

operations = [
migrations.RemoveField(
model_name='subtitle',
name='video',
),
migrations.DeleteModel(
name='Subtitle',
),
]
41 changes: 0 additions & 41 deletions edxval/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,47 +482,6 @@ def __unicode__(self):
return u'{lang} Transcript for {video}'.format(lang=self.language_code, video=self.video_id)


SUBTITLE_FORMATS = (
('srt', 'SubRip'),
('sjson', 'SRT JSON')
)


class Subtitle(models.Model):
"""
Subtitle for video

Attributes:
video: the video that the subtitles are for
fmt: the format of the subttitles file
"""
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)
video = models.ForeignKey(Video, related_name="subtitles")
fmt = models.CharField(max_length=20, db_index=True, choices=SUBTITLE_FORMATS)
language = models.CharField(max_length=8, db_index=True)
content = models.TextField(default='')

def __str__(self):
return '%s Subtitle for %s' % (self.language, self.video)

def get_absolute_url(self):
"""
Returns the full url link to the edx_video_id
"""
return reverse('subtitle-content', args=[self.video.edx_video_id, self.language])

@property
def content_type(self):
"""
Sjson is returned as application/json, otherwise text/plain
"""
if self.fmt == 'sjson':
return 'application/json'
else:
return 'text/plain'


class Cielo24Turnaround(object):
"""
Cielo24 turnarounds.
Expand Down
37 changes: 1 addition & 36 deletions edxval/tests/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
edx_video_id="thisis12char-thisis7",
status="test",
encoded_videos=[],
subtitles=[]
)
VIDEO_DICT_BEE_INVALID = dict(
client_video_id="Barking Bee",
Expand All @@ -80,7 +79,6 @@
edx_video_id="sloppy/sloth!!",
status="test",
encoded_videos=[],
subtitles=[]
)
ENCODED_VIDEO_DICT_NEGATIVE_FILESIZE = dict(
url="http://www.meowmix.com",
Expand All @@ -101,30 +99,16 @@
edx_video_id="ID",
status="test",
encoded_videos=[],
subtitles=[]
)
VIDEO_DICT_NON_LATIN_ID = dict(
client_video_id="Hungry Hamster",
duration=42,
edx_video_id="밥줘",
status="test",
encoded_videos=[],
subtitles=[]
)
PROFILE_INVALID_NAME = "lo/lol"
"""
Subtitles
"""
SUBTITLE_DICT_SRT = dict(
fmt="srt",
language="en",
content="0:0:0\nhello"
)
SUBTITLE_DICT_SJSON = dict(
fmt="sjson",
language="fr",
content='{"start": "00:00:00"}'
)

"""
Fish
"""
Expand Down Expand Up @@ -199,7 +183,6 @@
ENCODED_VIDEO_DICT_FISH_MOBILE,
ENCODED_VIDEO_DICT_FISH_DESKTOP
],
subtitles=[SUBTITLE_DICT_SRT, SUBTITLE_DICT_SJSON],
**VIDEO_DICT_FISH
)
COMPLETE_SET_FISH_WITH_HLS = dict(
Expand All @@ -208,15 +191,13 @@
ENCODED_VIDEO_DICT_FISH_DESKTOP,
ENCODED_VIDEO_DICT_FISH_HLS,
],
subtitles=[SUBTITLE_DICT_SRT, SUBTITLE_DICT_SJSON],
**VIDEO_DICT_FISH
)
COMPLETE_SET_TWO_MOBILE_FISH = dict(
encoded_videos=[
ENCODED_VIDEO_DICT_FISH_MOBILE,
ENCODED_VIDEO_DICT_FISH_MOBILE
],
subtitles=[SUBTITLE_DICT_SRT],
**VIDEO_DICT_FISH
)
COMPLETE_SET_UPDATE_FISH = dict(
Expand All @@ -225,38 +206,33 @@
ENCODED_VIDEO_DICT_UPDATE_FISH_DESKTOP,
ENCODED_VIDEO_DICT_UPDATE_FISH_HLS,
],
subtitles=[SUBTITLE_DICT_SRT],
**VIDEO_DICT_FISH
)
COMPLETE_SET_DIFFERENT_ID_UPDATE_FISH = dict(
encoded_videos=[
ENCODED_VIDEO_DICT_UPDATE_FISH_MOBILE,
ENCODED_VIDEO_DICT_UPDATE_FISH_DESKTOP
],
subtitles=[SUBTITLE_DICT_SRT, SUBTITLE_DICT_SJSON],
**VIDEO_DICT_DIFFERENT_ID_FISH
)
COMPLETE_SET_FIRST_HALF_UPDATE_FISH = dict(
encoded_videos=[
ENCODED_VIDEO_DICT_UPDATE_FISH_MOBILE,
ENCODED_VIDEO_DICT_FISH_DESKTOP
],
subtitles=[SUBTITLE_DICT_SRT, SUBTITLE_DICT_SJSON],
**VIDEO_DICT_FISH
)
COMPLETE_SET_UPDATE_ONLY_DESKTOP_FISH = dict(
encoded_videos=[
ENCODED_VIDEO_DICT_UPDATE_FISH_DESKTOP
],
subtitles=[SUBTITLE_DICT_SRT],
**VIDEO_DICT_FISH
)
COMPLETE_SET_INVALID_ENCODED_VIDEO_FISH = dict(
encoded_videos=[
ENCODED_VIDEO_DICT_FISH_MOBILE,
ENCODED_VIDEO_DICT_FISH_INVALID_PROFILE
],
subtitles=[SUBTITLE_DICT_SRT],
**VIDEO_DICT_FISH
)
COMPLETE_SET_INVALID_VIDEO_FISH = dict(
Expand All @@ -268,7 +244,6 @@
ENCODED_VIDEO_DICT_FISH_MOBILE,
ENCODED_VIDEO_DICT_FISH_DESKTOP
],
subtitles=[SUBTITLE_DICT_SRT]
)

COMPLETE_SETS_ALL_INVALID = [
Expand Down Expand Up @@ -300,38 +275,33 @@
encoded_videos=[
ENCODED_VIDEO_DICT_STAR
],
subtitles=[SUBTITLE_DICT_SRT],
**VIDEO_DICT_STAR
)
COMPLETE_SET_UPDATE_STAR = dict(
encoded_videos=[
ENCODED_VIDEO_UPDATE_DICT_STAR
],
subtitles=[SUBTITLE_DICT_SRT],
**VIDEO_DICT_STAR
)
COMPLETE_SET_WITH_COURSE_KEY = dict(
courses=['edX/DemoX/Demo_Course'],
encoded_videos=[
ENCODED_VIDEO_DICT_STAR
],
subtitles=[SUBTITLE_DICT_SRT],
**VIDEO_DICT_STAR
)
COMPLETE_SET_WITH_SOME_INVALID_COURSE_KEY = dict(
courses=[None, False, '', 'edX/DemoX/Astonomy'],
encoded_videos=[
ENCODED_VIDEO_DICT_STAR
],
subtitles=[SUBTITLE_DICT_SRT],
**VIDEO_DICT_STAR
)
COMPLETE_SET_WITH_OTHER_COURSE_KEYS = dict(
courses=['edX/DemoX/Astonomy', 'edX/DemoX/Zoology'],
encoded_videos=[
ENCODED_VIDEO_DICT_STAR
],
subtitles=[SUBTITLE_DICT_SRT],
**VIDEO_DICT_STAR
)
COMPLETE_SET_NOT_A_LIST = dict(
Expand All @@ -341,7 +311,6 @@
bitrate=42,
profile=1
),
subtitles=[SUBTITLE_DICT_SRT],
**VIDEO_DICT_STAR
)
COMPLETE_SET_EXTRA_VIDEO_FIELD = dict(
Expand All @@ -354,7 +323,6 @@
video="This should be overridden by parent video field"
)
],
subtitles=[SUBTITLE_DICT_SRT],
**VIDEO_DICT_STAR
)
"""
Expand All @@ -378,23 +346,20 @@
edx_video_id="zestttt",
status="test",
encoded_videos=[],
subtitles=[]
)
VIDEO_DICT_ANIMAL = dict(
client_video_id="Average Animal",
duration=111.00,
edx_video_id="mediocrity",
status="test",
encoded_videos=[],
subtitles=[]
)
VIDEO_DICT_UPDATE_ANIMAL = dict(
client_video_id="Above Average Animal",
duration=999.00,
edx_video_id="mediocrity",
status="test",
encoded_videos=[],
subtitles=[]
)

VIDEO_TRANSCRIPT_CIELO24 = dict(
Expand Down
Loading