Skip to content

Conversation

@kdmccormick
Copy link
Member

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.

@kdmccormick kdmccormick changed the title refactor: Move upload/delete transcript int video_config service refactor: Move upload/delete transcript into video_config service Nov 19, 2025
@kdmccormick kdmccormick force-pushed the kdmccormick/upload-delete-transcript branch 3 times, most recently from b27c671 to 097c430 Compare November 20, 2025 04:45
@kdmccormick kdmccormick marked this pull request as ready for review November 20, 2025 04:45
This moves edx-platform-specific logic out of the VideoBlock,
in preparation for the VideoBlock extraction:
openedx#36282
@kdmccormick kdmccormick force-pushed the kdmccormick/upload-delete-transcript branch from 696e7df to a738d26 Compare November 20, 2025 16:42
@farhan farhan added the create-sandbox open-craft-grove should create a sandbox environment from this PR label Nov 24, 2025
@open-craft-grove
Copy link

Sandbox deployment failed 💥
Please check the settings and requirements.
Retry deployment by pushing a new commit or updating the requirements/settings in the pull request's description.
📜 Failure Logs
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove
Copy link

Sandbox deployment failed 💥
Please check the settings and requirements.
Retry deployment by pushing a new commit or updating the requirements/settings in the pull request's description.
📜 Failure Logs
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@farhan
Copy link
Contributor

farhan commented Nov 25, 2025

Transcripts are not uploading in the content library

Screenshot 2025-11-25 at 10 57 59 AM

Can raise:
* UnicodeDecodeError
* TranscriptsGenerationException
Copy link
Contributor

@farhan farhan Nov 21, 2025

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are appending static and passing in the param here unlike we are setting it in the transcripts field of video block in old code here

Which will possibly not update the field while saving here

UsageKey,
)
from opaque_keys.edx.locator import LibraryLocatorV2
from xblocks_contrib.video import VideoBlock
Copy link
Contributor

@farhan farhan Nov 25, 2025

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.

@farhan farhan requested a review from feanil November 26, 2025 11:49
),
status=201,
)
except (TranscriptsGenerationException, UnicodeDecodeError):
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

create-sandbox open-craft-grove should create a sandbox environment from this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants