From ecd88fe8a248505ad80ff2926287e65afe612bb6 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 21 Oct 2023 15:36:08 +0100 Subject: [PATCH] ignore empty items --- management/commands/generate_clips.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/management/commands/generate_clips.py b/management/commands/generate_clips.py index 4f2c9e0..313956b 100644 --- a/management/commands/generate_clips.py +++ b/management/commands/generate_clips.py @@ -26,6 +26,8 @@ class Command(BaseCommand): for e in item.models.Item.objects.filter(data__title=i.data['title']): if 'type' not in e.data: print("ignoring invalid video", e) + if not e.files.filter(selected=True).exists(): + continue source = e.files.filter(selected=True)[0].data.path ext = os.path.splitext(source)[1] type_ = e.data['type'][0].lower()