-
Notifications
You must be signed in to change notification settings - Fork 4.2k
refactor: Move upload/delete transcript into video_config service #37657
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
base: master
Are you sure you want to change the base?
refactor: Move upload/delete transcript into video_config service #37657
Conversation
b27c671 to
097c430
Compare
This moves edx-platform-specific logic out of the VideoBlock, in preparation for the VideoBlock extraction: openedx#36282
696e7df to
a738d26
Compare
|
Sandbox deployment failed 💥 |
|
Sandbox deployment failed 💥 |
|
Sandbox deployment successful 🚀 |
|
Transcripts are not uploading in the content library
|
| Can raise: | ||
| * UnicodeDecodeError | ||
| * TranscriptsGenerationException |
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.
Should we throw platform specific exceptions, for example TranscriptsGenerationException here? 🤔
Even if we throw them we can't catch the specific exceptions within the external XBlock.
So if we can only catch the general exception in the external XBlock. Shouldn't we only throw general exceptions?
| if is_library: | ||
| # Save transcript as static asset in Learning Core if is a library component | ||
| filename = f'transcript-{new_language_code}.srt' | ||
| add_library_block_static_asset_file(video_block.usage_key, f"static/{filename}", content) |
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.
| UsageKey, | ||
| ) | ||
| from opaque_keys.edx.locator import LibraryLocatorV2 | ||
| from xblocks_contrib.video import VideoBlock |
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.
Shouldn't we import it from the xmodule.
I am also having import VideoBlock in this PR, will be great if we could skip its annotation until we are done with extraction work.
| ), | ||
| status=201, | ||
| ) | ||
| except (TranscriptsGenerationException, UnicodeDecodeError): |
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.
In the extracted XBlock, we are not going to capture these special exceptions.
Further discussed here

Description
This moves edx-platform-specific logic out of the VideoBlock, in preparation for the VideoBlock extraction:
#36282
Testing instructions
Go to studio, and in a course, add a transcript, and delete it.
Do the same in a v2 library.