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: Video editor supports transcripts [FC-0076] #36058

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
9cdf45f
feat: Updates to support save video with transcript in library home
ChrisChV Dec 25, 2024
3885dd1
style: Fix lint
ChrisChV Dec 25, 2024
a723e96
feat: Updated code to get english transcript from filename
ChrisChV Jan 15, 2025
1c2a575
style: Fix lint
ChrisChV Jan 15, 2025
74f027f
feat: Upload transcript file as static asset in Learning Core in libr…
ChrisChV Jan 17, 2025
2adacee
style: Fix lint
ChrisChV Jan 20, 2025
0393829
feat: Updates to support download transcripts from youtube in vlibrar…
ChrisChV Jan 22, 2025
e27221e
style: Fix lint
ChrisChV Jan 22, 2025
05067f6
test: Add test for download youtube transcripts in library content
ChrisChV Jan 22, 2025
2f53a75
style: Fix lint
ChrisChV Jan 22, 2025
5c6819a
feat: Support copy transcripts from a library
ChrisChV Jan 22, 2025
95b51e8
refactor: Allow use edx_video_id (edxval) in new runtime
ChrisChV Jan 23, 2025
c42e223
refactor: Adds new edx_video_id when copy to course
ChrisChV Jan 24, 2025
4bf3af3
refactor: Remove unnevessary code
ChrisChV Jan 24, 2025
1de1d4e
feat: Support delete transcripts in library
ChrisChV Jan 25, 2025
a59898d
style: Fix lint
ChrisChV Jan 27, 2025
9173ed8
Merge branch 'master' into chris/FAL-3989-video-transcripts
ChrisChV Jan 29, 2025
590a5cd
style: Nits on the code
ChrisChV Jan 30, 2025
0e54450
refactor: Update replace_transcript to verify transcript
ChrisChV Jan 30, 2025
5685f16
refactor: Verify LibraryLocatorV2 in manage_video_subtitles_save to a…
ChrisChV Jan 30, 2025
e4f7c72
style: Add comment in transcripts_ajax.py
ChrisChV Jan 30, 2025
b478ac5
refactor: _get_item to avoid return isLibraryContent
ChrisChV Jan 30, 2025
173a0af
refactor: studio_transcript to separate methods in separated functions
ChrisChV Jan 30, 2025
4532a2a
refactor: Update code in video_handlers to avoid "static/None"
ChrisChV Jan 30, 2025
bb10d18
style: Fix nit
ChrisChV Jan 30, 2025
0203dac
chore: Fix merge conflicts
ChrisChV Feb 12, 2025
a254fe4
refactor: Use usage_key in some places of the code
ChrisChV Feb 12, 2025
34e5cbc
refactor: _import_transcripts created in helpers.py
ChrisChV Feb 12, 2025
c73f82c
refactor: save_video_transcript_in_learning_core created
ChrisChV Feb 13, 2025
ddb6953
refactor: _studio_transcript_upload in video_handlers
ChrisChV Feb 13, 2025
46aa8ca
refactor: transcripts_ajax to avoid use edx_video_id in filenames in …
ChrisChV Feb 13, 2025
5bb426f
refactor: Update _get_item in transcripts_ajax to use check_permissio…
ChrisChV Feb 14, 2025
5dda777
refactor: Delete lib_permissions from content_libraries/api.py
ChrisChV Feb 14, 2025
53f42fa
style: Fix typos in comments in video_handlers.py
ChrisChV Feb 14, 2025
9c7e4e8
style: Update comment of test_export_to_xml_without_video_id
ChrisChV Feb 14, 2025
8c6a3dd
fix: Fix tests and lint
ChrisChV Feb 14, 2025
0745f09
fix: Sync transcripts in video blocks from library to course
ChrisChV Feb 14, 2025
eff9d04
test: Tests for sync video block
ChrisChV Feb 17, 2025
4973037
style: Fix lint
ChrisChV Feb 17, 2025
6903be2
style: Nits and comments in the code
ChrisChV Feb 19, 2025
e6ae3ad
style: Fix lint
ChrisChV Feb 19, 2025
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
Prev Previous commit
Next Next commit
refactor: Verify LibraryLocatorV2 in manage_video_subtitles_save to a…
…void raise AttributeError
ChrisChV committed Jan 30, 2025
commit 5685f16389de256e1a4f5cb7010a7783ff7a96fd
25 changes: 13 additions & 12 deletions xmodule/video_block/transcripts_utils.py
Original file line number Diff line number Diff line change
@@ -20,12 +20,14 @@
from opaque_keys.edx.keys import UsageKeyV2
from pysrt import SubRipFile, SubRipItem, SubRipTime
from pysrt.srtexc import Error
from opaque_keys.edx.locator import LibraryLocatorV2

from openedx.core.djangoapps.xblock.api import get_component_from_usage_key
from xmodule.contentstore.content import StaticContent
from xmodule.contentstore.django import contentstore
from xmodule.exceptions import NotFoundError


from .bumper_utils import get_bumper_settings

try:
@@ -498,18 +500,17 @@ def manage_video_subtitles_save(item, user, old_metadata=None, generate_translat
remove_subs_from_store(video_id, item, lang)

reraised_message = ''
for lang in new_langs: # 3b
try:
generate_sjson_for_all_speeds(
item,
item.transcripts[lang],
{speed: subs_id for subs_id, speed in youtube_speed_dict(item).items()},
lang,
)
except TranscriptException:
pass
except AttributeError:
pass
if not isinstance(item.usage_key.context_key, LibraryLocatorV2):
for lang in new_langs: # 3b
try:
generate_sjson_for_all_speeds(
item,
item.transcripts[lang],
{speed: subs_id for subs_id, speed in youtube_speed_dict(item).items()},
lang,
)
except TranscriptException:
pass
if reraised_message:
item.save_with_metadata(user)
raise TranscriptException(reraised_message)