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

feat: remove transcript content from course-transcripts endpoint #527

Merged
merged 3 commits into from
Sep 13, 2024
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
4 changes: 1 addition & 3 deletions edxval/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ def get_videos_for_course(course_id, sort_field=None, sort_dir=SortDirection.asc

def get_transcript_details_for_course(course_id):
"""
Gets all the transcript for a course and bundles up data.
Get all the transcripts for a course and return details.

Args:
course_id (String)
Expand All @@ -746,7 +746,6 @@ def get_transcript_details_for_course(course_id):
'edx_video_id': {
'lang_code': {
'provider': 'What the provider is',
'content': 'Content of the transcript',
'file_format': 'file format',
'url': 'location of the file',
'name': 'name of the file',
Expand All @@ -766,7 +765,6 @@ def get_transcript_details_for_course(course_id):
for video_transcript in video_transcripts:
transcript_data[video_transcript.language_code] = {
'provider': video_transcript.provider,
'content': video_transcript.transcript.file.read(),
'file_format': video_transcript.file_format,
'url': video_transcript.transcript.url,
'name': video_transcript.transcript.name,
Expand Down
2 changes: 0 additions & 2 deletions edxval/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3159,14 +3159,12 @@ def test_get_transcript_details_for_course(self):
course_transcript = api.get_transcript_details_for_course(self.course_id1)

self.assertEqual(course_transcript['super-soaker']['en']['provider'], TranscriptProviderType.THREE_PLAY_MEDIA)
self.assertIn('content', course_transcript['super-soaker']['en'])
self.assertEqual(course_transcript['super-soaker']['en']['file_format'], utils.TranscriptFormat.SRT)
self.assertIn('url', course_transcript['super-soaker']['en'])
self.assertIn('name', course_transcript['super-soaker']['en'])
self.assertIn('size', course_transcript['super-soaker']['en'])

self.assertEqual(course_transcript['super-soaker']['fr']['provider'], TranscriptProviderType.CIELO24)
self.assertIn('content', course_transcript['super-soaker']['fr'])
self.assertEqual(course_transcript['super-soaker']['en']['file_format'], utils.TranscriptFormat.SRT)
self.assertIn('url', course_transcript['super-soaker']['fr'])
self.assertIn('name', course_transcript['super-soaker']['fr'])
Expand Down
Loading