RepeatMultiple bug fix

Repeat amount could be 0
This commit is contained in:
Chev 2026-01-25 17:48:08 -08:00
parent 8b6ed9ddf9
commit 1f75d0189b
Signed by: chev2
GPG key ID: 0B212D6AED495EC9

View file

@ -53,7 +53,10 @@ class RepeatMultiple(Effect):
def apply(self, clip: Clip) -> Clip:
random_dur = self.rng.uniform(self.repeat_video_duration_min, self.repeat_video_duration_max)
repeat_amt = int((clip.duration / random_dur) * 0.5)
repeat_amt = min(
int((clip.duration / random_dur) * 0.5),
2
)
start_offset = self.rng.uniform(0, clip.duration - random_dur)
new_clip = clip.subclipped(start_offset, start_offset + random_dur)