From 2688000c07360cfa3e34ae930126ee3c18f95a0e Mon Sep 17 00:00:00 2001 From: farhan Date: Wed, 17 Dec 2025 16:20:53 +0500 Subject: [PATCH] chore: more cleanup --- .../video_config/transcripts_utils.py | 25 ------------------- xmodule/video_block/video_handlers.py | 4 --- 2 files changed, 29 deletions(-) diff --git a/openedx/core/djangoapps/video_config/transcripts_utils.py b/openedx/core/djangoapps/video_config/transcripts_utils.py index be86324cd6..4a1e53e902 100644 --- a/openedx/core/djangoapps/video_config/transcripts_utils.py +++ b/openedx/core/djangoapps/video_config/transcripts_utils.py @@ -561,31 +561,6 @@ def generate_sjson_for_all_speeds(block, user_filename, result_subs_dict, lang): ) -def get_or_create_sjson(block, transcripts): - """ - Get sjson if already exists, otherwise generate it. - - Generate sjson with subs_id name, from user uploaded srt. - Subs_id is extracted from srt filename, which was set by user. - - Args: - transcipts (dict): dictionary of (language: file) pairs. - - Raises: - TranscriptException: when srt subtitles do not exist, - and exceptions from generate_subs_from_source. - """ - user_filename = transcripts[block.transcript_language] - user_subs_id = os.path.splitext(user_filename)[0] - source_subs_id, result_subs_dict = user_subs_id, {1.0: user_subs_id} - try: - sjson_transcript = Transcript.asset(block.location, source_subs_id, block.transcript_language).data - except NotFoundError: # generating sjson from srt - generate_sjson_for_all_speeds(block, user_filename, result_subs_dict, block.transcript_language) - sjson_transcript = Transcript.asset(block.location, source_subs_id, block.transcript_language).data - return sjson_transcript - - def get_video_ids_info(edx_video_id, youtube_id_1_0, html5_sources): """ Returns list internal or external video ids. diff --git a/xmodule/video_block/video_handlers.py b/xmodule/video_block/video_handlers.py index d7095a4e6d..ce9603e5cd 100644 --- a/xmodule/video_block/video_handlers.py +++ b/xmodule/video_block/video_handlers.py @@ -24,15 +24,11 @@ from openedx.core.djangoapps.content_libraries import api as lib_api from openedx.core.djangoapps.video_config.transcripts_utils import ( Transcript, - TranscriptException, clean_video_id, - generate_sjson_for_all_speeds, get_html5_ids, - get_or_create_sjson, get_transcript_from_contentstore, remove_subs_from_store, subs_filename, - youtube_speed_dict ) from xblocks_contrib.video.exceptions import ( TranscriptsGenerationException,