From 645efce57eca62f1905a8bd78a2afc9f250f4ad3 Mon Sep 17 00:00:00 2001 From: farhan Date: Mon, 16 Feb 2026 20:55:03 +0500 Subject: [PATCH] chore: optimize VideoBlock code - Change the `i18n` service declaration from `wants` to `needs`, since the runtime must provide it for the block to function correctly. - Update the `public_view` webpack JS reference from `VideoBlockMain` to `VideoBlockDisplay`, as all VideoBlock JS files are bundled into `VideoBlockDisplay` and `VideoBlockMain` is not referring to anything or no longer exists in the repository. --- xmodule/video_block/video_block.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xmodule/video_block/video_block.py b/xmodule/video_block/video_block.py index 4cf58420b69e..d5c4f509c39f 100644 --- a/xmodule/video_block/video_block.py +++ b/xmodule/video_block/video_block.py @@ -105,8 +105,8 @@ EXPORT_IMPORT_STATIC_DIR = 'static' -@XBlock.wants('settings', 'completion', 'i18n', 'request_cache', 'video_config') -@XBlock.needs('mako', 'user') +@XBlock.wants('settings', 'completion', 'request_cache', 'video_config') +@XBlock.needs('mako', 'user', 'i18n') class _BuiltInVideoBlock( VideoFields, VideoTranscriptsMixin, VideoStudioViewHandlers, VideoStudentViewHandlers, EmptyDataRawMixin, XmlMixin, EditingMixin, XModuleToXBlockMixin, @@ -265,7 +265,7 @@ def public_view(self, context): fragment = Fragment(self.get_html(view=PUBLIC_VIEW, context=context)) add_css_to_fragment(fragment, 'VideoBlockDisplay.css') - add_webpack_js_to_fragment(fragment, 'VideoBlockMain') + add_webpack_js_to_fragment(fragment, 'VideoBlockDisplay') fragment.initialize_js('Video') return fragment