fix generate

This commit is contained in:
j 2026-01-25 18:50:44 +01:00
commit 69344cc837

View file

@ -873,9 +873,6 @@ def generate_clips(options):
source = e.files.filter(selected=True)[0].data.path source = e.files.filter(selected=True)[0].data.path
ext = os.path.splitext(source)[1] ext = os.path.splitext(source)[1]
type_ = e.data['type'][0].lower() type_ = e.data['type'][0].lower()
if type_ == "source":
source_target = target
clip['loudnorm'] = get_loudnorm(e.files.filter(selected=True)[0])
if type_.startswith('ai:'): if type_.startswith('ai:'):
if 'ai' not in clip: if 'ai' not in clip:
clip['ai'] = {} clip['ai'] = {}
@ -890,6 +887,9 @@ def generate_clips(options):
clip[type_] = target clip[type_] = target
target = os.path.join(prefix, 'video', type_, i.data['title'] + ext) target = os.path.join(prefix, 'video', type_, i.data['title'] + ext)
os.makedirs(os.path.dirname(target), exist_ok=True) os.makedirs(os.path.dirname(target), exist_ok=True)
if type_ == "source":
source_target = target
clip['loudnorm'] = get_loudnorm(e.files.filter(selected=True)[0])
if os.path.islink(target): if os.path.islink(target):
os.unlink(target) os.unlink(target)
os.symlink(source, target) os.symlink(source, target)