Compare commits

..

2 commits

Author SHA1 Message Date
j
c1c7fc27d3 update items 2023-10-21 15:46:08 +01:00
j
215f0db071 islink not exists 2023-10-21 15:46:03 +01:00
2 changed files with 6 additions and 1 deletions

View file

@ -59,7 +59,7 @@ class Command(BaseCommand):
src = source.data.path src = source.data.path
target = os.path.join(prefix, 'voice_over', batch, '%s.wav' % fragment_id) target = os.path.join(prefix, 'voice_over', batch, '%s.wav' % fragment_id)
os.makedirs(os.path.dirname(target), exist_ok=True) os.makedirs(os.path.dirname(target), exist_ok=True)
if os.path.exists(target): if os.path.islink(target):
os.unlink(target) os.unlink(target)
os.symlink(src, target) os.symlink(src, target)
voice_over[fragment_id][batch] = { voice_over[fragment_id][batch] = {

View file

@ -19,6 +19,11 @@ def upgrade_originals():
def remove_deselected_files(): def remove_deselected_files():
il = itemlist.models.List.objects.get(name='New Originals') il = itemlist.models.List.objects.get(name='New Originals')
for i in il.items.all(): for i in il.items.all():
changed = False
for f in i.files.filter(selected=False): for f in i.files.filter(selected=False):
f.data.delete() f.data.delete()
f.delete() f.delete()
changed = True
if changed:
i.save()