From 06e099e79791821af8dbb0fb1c3b4540384973de Mon Sep 17 00:00:00 2001 From: j Date: Sat, 24 Jan 2026 23:25:53 +0100 Subject: [PATCH] multiple versions of same type --- render.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/render.py b/render.py index ef840a0..ffbc43f 100644 --- a/render.py +++ b/render.py @@ -873,20 +873,26 @@ def generate_clips(options): source = e.files.filter(selected=True)[0].data.path ext = os.path.splitext(source)[1] type_ = e.data['type'][0].lower() - target = os.path.join(prefix, 'video', type_, i.data['title'] + ext) - os.makedirs(os.path.dirname(target), exist_ok=True) - if os.path.islink(target): - os.unlink(target) - os.symlink(source, target) if type_ == "source": source_target = target clip['loudnorm'] = get_loudnorm(e.files.filter(selected=True)[0]) if type_.startswith('ai:'): if 'ai' not in clip: clip['ai'] = {} - clip['ai'][type_[3:]] = target + ai_type = type_[3:] + n = 1 + while ai_type in clip['ai']: + ai_type = '%s-%s' % (type_[3:], n) + n += 1 + clip['ai'][ai_type] = target + type_ = ai_type else: clip[type_] = target + target = os.path.join(prefix, 'video', type_, i.data['title'] + ext) + os.makedirs(os.path.dirname(target), exist_ok=True) + if os.path.islink(target): + os.unlink(target) + os.symlink(source, target) durations.append(e.files.filter(selected=True)[0].duration) if not durations: print(i.public_id, 'no duration!', clip)