fix clip patch
This commit is contained in:
parent
f1d55b89d4
commit
d2abf860b9
1 changed files with 4 additions and 6 deletions
|
@ -37,15 +37,13 @@ class Engine:
|
||||||
'position': clip['in']
|
'position': clip['in']
|
||||||
}]
|
}]
|
||||||
for video_id in inpoints:
|
for video_id in inpoints:
|
||||||
for i, inpoint in sorted(
|
for i, inpoint in enumerate(sorted(
|
||||||
inpoints[video_id], key=lambda inpoint: inpoint['position']
|
inpoints[video_id], key=lambda inpoint: inpoint['position']
|
||||||
):
|
)):
|
||||||
if i < len(inpoints[video_id]) - 1:
|
if i < len(inpoints[video_id]) - 1:
|
||||||
clips[inpoint['index']]['out'] = inpoints[video_id][i + 1]
|
clips[inpoint['index']]['out'] = inpoints[video_id][i + 1]['position']
|
||||||
else:
|
else:
|
||||||
clips[inpoint['index']]['out'] self.pandora.get({
|
clips[inpoint['index']]['out'] = self.pandora.get(video_id, ['duration'])['duration']
|
||||||
'id': id, keys: ['duration']
|
|
||||||
})['duration']
|
|
||||||
return clips
|
return clips
|
||||||
|
|
||||||
def _shift_clips(self, clips):
|
def _shift_clips(self, clips):
|
||||||
|
|
Loading…
Reference in a new issue