From 21d32252699dd9fbb7c76becee760cbe73236678 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 29 Oct 2023 19:57:39 +0100 Subject: [PATCH] fail for 0 lenght clips --- management/commands/generate_clips.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/management/commands/generate_clips.py b/management/commands/generate_clips.py index 270c6bd..94098cc 100644 --- a/management/commands/generate_clips.py +++ b/management/commands/generate_clips.py @@ -52,6 +52,9 @@ class Command(BaseCommand): clip[type_] = target durations.append(e.files.filter(selected=True)[0].duration) clip["duration"] = min(durations) + if not clip["duration"]: + print('!!', durations, clip) + continue clip['tags'] = i.data.get('tags', []) clip['editingtags'] = i.data.get('editingtags', []) name = os.path.basename(clip['original'])