diff --git a/render.py b/render.py index 9045ecc..d2ee30f 100644 --- a/render.py +++ b/render.py @@ -458,7 +458,7 @@ def get_fragments(clips, voice_over, prefix): print("FIXME", i) continue type_ = i.data['type'][0].lower() - target = os.path.join(prefix, 'video', type_, i.data['title'] + ext) + target = os.path.join(prefix, 'video', type_, "%s-%s%s" % (i.data['title'], i.public_id, ext)) sources.append(target) fragment['clips'] = [] for clip in clips: @@ -964,6 +964,9 @@ def generate_clips(options): not_yet = itemlist.models.List.objects.filter(name='Not yet').first() if not_yet: skip += [i.public_id for i in not_yet.get_items(not_yet.user).all()] + if skip: + skip = list(set(skip)) + print("skipping %s clips" % len(skip)) for i in item.models.Item.objects.filter(sort__type='source'): if i.public_id in skip: continue @@ -997,7 +1000,7 @@ def generate_clips(options): ai_type = '%s-%s' % (type_[3:], n) n += 1 type_ = 'ai:' + ai_type - target = os.path.join(prefix, 'video', type_, i.data['title'] + ext) + target = os.path.join(prefix, 'video', type_, "%s-%s%s" % (i.data['title'], i.public_id, ext)) if ai_type: clip['ai'][ai_type] = target if type_ == "source": @@ -1066,7 +1069,7 @@ def generate_clips(options): source = vo.files.filter(selected=True)[0] src = source.data.path ext = src.split('.')[-1] - target = os.path.join(prefix, 'voice_over', fragment, '%s-%s.%s' % (type, variant, ext)) + target = os.path.join(prefix, 'voice_over', fragment, '%s-%s-%s.%s' % (type, variant, vo.public_id, ext)) os.makedirs(os.path.dirname(target), exist_ok=True) if os.path.islink(target): os.unlink(target) @@ -1096,7 +1099,7 @@ def generate_clips(options): if ai: ai_source = ai.files.filter(selected=True)[0] ai_src = ai_source.data.path - ai_target = os.path.join(prefix, 'voice_video', fragment, '%s-%s.%s' % (type, variant, 'mp4')) + ai_target = os.path.join(prefix, 'voice_video', fragment, '%s-%s-%s.%s' % (type, variant, ai.public_id, 'mp4')) os.makedirs(os.path.dirname(ai_target), exist_ok=True) if os.path.islink(ai_target): os.unlink(ai_target) @@ -1219,6 +1222,8 @@ def fragment_statistics(): not_yet = itemlist.models.List.objects.filter(name='Not yet').first() if not_yet: skip += [i.public_id for i in not_yet.get_items(not_yet.user).all()] + if skip: + skip = list(set(skip)) for l in itemlist.models.List.objects.filter(status='featured').order_by('name'): if l.name.split(' ')[0].isdigit():