-
Notifications
You must be signed in to change notification settings - Fork 31
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
add: util method in edx-val for listing transcript_languages for a course #565
base: master
Are you sure you want to change the base?
Conversation
b7ea187
to
5bc096f
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #565 +/- ##
==========================================
+ Coverage 94.58% 94.60% +0.02%
==========================================
Files 32 32
Lines 3178 3191 +13
Branches 122 122
==========================================
+ Hits 3006 3019 +13
Misses 154 154
Partials 18 18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
a6e2530
to
5cd9966
Compare
@@ -733,6 +733,30 @@ def get_videos_for_course(course_id, sort_field=None, sort_dir=SortDirection.asc | |||
) | |||
|
|||
|
|||
@cachetools.func.ttl_cache(maxsize=None, ttl=settings.TTL_CACHE_TIMEOUT) | |||
def get_transcript_languages(course_id, provider_type): | |||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method returns a language even if only one of the available course videos has a transcript in that language. Is this expected behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, it's expected. Output will be union of all transcript_languages with provider_type=edx_ai_translations
598ec8e
to
be6b5d3
Compare
edxval/api.py
Outdated
Returns: | ||
(list): A list of language codes | ||
""" | ||
course_video_ids = CourseVideo.objects.filter(course_id=course_id).values_list('video__id') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only the active/non-hidden videos should be used, in my opinion.
e6f4bd2
to
af472a7
Compare
@@ -18,6 +17,7 @@ | |||
from lxml.etree import Element, SubElement | |||
from pysrt.srtexc import Error | |||
|
|||
import cachetools.func |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this import should be in 2nd level as this is a 3rd party package. Not sure why quality did not fail on this. You can try isort to fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've already used isort on this file
e424f1b
to
0855bc0
Compare
PROD-4305
This PR adds the utils method in edx-val for listing transcript_languages for a course.