ignore empty items

This commit is contained in:
j 2023-10-21 15:36:08 +01:00
parent de96448137
commit ecd88fe8a2

View file

@ -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()