fix clip patch

This commit is contained in:
rlx 2018-01-26 12:01:36 +01:00
parent f1d55b89d4
commit d2abf860b9

View file

@ -37,15 +37,13 @@ class Engine:
'position': clip['in']
}]
for video_id in inpoints:
for i, inpoint in sorted(
for i, inpoint in enumerate(sorted(
inpoints[video_id], key=lambda inpoint: inpoint['position']
):
)):
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:
clips[inpoint['index']]['out'] self.pandora.get({
'id': id, keys: ['duration']
})['duration']
clips[inpoint['index']]['out'] = self.pandora.get(video_id, ['duration'])['duration']
return clips
def _shift_clips(self, clips):