fix join_subtitles
This commit is contained in:
parent
4e767b7268
commit
a65ab31595
1 changed files with 4 additions and 1 deletions
|
|
@ -876,6 +876,7 @@ def shift_clips(data, offset):
|
||||||
for clip in data:
|
for clip in data:
|
||||||
clip['in'] += offset
|
clip['in'] += offset
|
||||||
clip['out'] += offset
|
clip['out'] += offset
|
||||||
|
return data
|
||||||
|
|
||||||
def scene_subtitles(scene, options):
|
def scene_subtitles(scene, options):
|
||||||
import item.models
|
import item.models
|
||||||
|
|
@ -1075,7 +1076,9 @@ def join_subtitles(base_prefix, options):
|
||||||
scenes = list(sorted(glob('%s/*/scene.json' % base_prefix)))
|
scenes = list(sorted(glob('%s/*/scene.json' % base_prefix)))
|
||||||
data = []
|
data = []
|
||||||
position = 0
|
position = 0
|
||||||
for scene in scenes:
|
for scene_json in scenes:
|
||||||
|
with open(scene_json) as fd:
|
||||||
|
scene = json.load(fd)
|
||||||
subs = scene_subtitles(scene, options)
|
subs = scene_subtitles(scene, options)
|
||||||
data += shift_clips(subs, position)
|
data += shift_clips(subs, position)
|
||||||
position += get_scene_duration(scene)
|
position += get_scene_duration(scene)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue