Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
2e78fce7
Commit
2e78fce7
authored
11 years ago
by
Alexander Kryklia
Browse files
Options
Downloads
Patches
Plain Diff
Allow /static in transcript names.
parent
663671ec
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/lib/xmodule/xmodule/video_module/transcripts_utils.py
+11
-3
11 additions, 3 deletions
common/lib/xmodule/xmodule/video_module/transcripts_utils.py
with
11 additions
and
3 deletions
common/lib/xmodule/xmodule/video_module/transcripts_utils.py
+
11
−
3
View file @
2e78fce7
...
...
@@ -327,7 +327,10 @@ def manage_video_subtitles_save(item, user, old_metadata=None, generate_translat
This whole action ensures that after user changes video fields, proper `sub` files, corresponding
to new values of video fields, will be presented in system.
# 2. Generate transcripts translation only when user clicks `save` button, not while switching tabs.
# 2 convert /static/filename.srt to filename.srt in self.transcripts.
(it is done to allow user to enter both /static/filename.srt and filename.srt)
# 3. Generate transcripts translation only when user clicks `save` button, not while switching tabs.
a) delete sjson translation for those languages, which were removed from `item.transcripts`.
Note: we are not deleting old SRT files to give user more flexibility.
b) For all SRT files in`item.transcripts` regenerate new SJSON files.
...
...
@@ -358,17 +361,22 @@ def manage_video_subtitles_save(item, user, old_metadata=None, generate_translat
)
# 2.
if
generate_translation
:
for
lang
,
filename
in
item
.
transcripts
.
items
():
item
.
transcripts
[
lang
]
=
os
.
path
.
split
(
filename
)[
-
1
]
# 3.
if
generate_translation
:
old_langs
=
set
(
old_metadata
.
get
(
'
transcripts
'
,
{}))
if
old_metadata
else
set
()
new_langs
=
set
(
item
.
transcripts
)
for
lang
in
old_langs
.
difference
(
new_langs
):
#
2
a
for
lang
in
old_langs
.
difference
(
new_langs
):
#
3
a
for
video_id
in
possible_video_id_list
:
if
video_id
:
remove_subs_from_store
(
video_id
,
item
,
lang
)
reraised_message
=
''
for
lang
in
new_langs
:
#
2
b
for
lang
in
new_langs
:
#
3
b
try
:
generate_sjson_for_all_speeds
(
item
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment