This commit is contained in:
j 2023-10-09 14:10:34 +01:00
commit e84ea31147
4 changed files with 15 additions and 30 deletions

View file

@ -23,7 +23,7 @@ class Command(BaseCommand):
clip = {}
durations = []
for e in item.models.Item.objects.filter(data__title=i.data['title']):
source = i.files.all()[0].data.path
source = e.files.all()[0].data.path
ext = os.path.splitext(source)[1]
type_ = e.data['type'][0].lower()
target = os.path.join(prefix, type_, i.data['title'] + ext)

View file

@ -8,7 +8,7 @@ from ...render import compose, render
class Command(BaseCommand):
help = 'generate symlinks to clips and clips.json'
help = 'genrate kdenlive porject and render'
def add_arguments(self, parser):
parser.add_argument('--prefix', action='store', dest='prefix', default="/srv/t_for_time", help='prefix to build clips in')
@ -23,6 +23,7 @@ class Command(BaseCommand):
with open(os.path.join(prefix, "clips.json")) as fd:
clips = json.load(fd)
scene = compose(clips, target=target, base=base)
render(prefix, scene)
render(prefix, scene, 'scene-%s-' % base)
with open(os.path.join(prefix, 'scene-%s.json' % base), 'w') as fd:
json.dump(scene, fd, indent=2, ensure_ascii=False)