Compare commits
No commits in common. "de96448137a1c1bef44e273ddd55091b46692887" and "72ab1b1d13225d29ee83cf5636b8c4ea5431fbd5" have entirely different histories.
de96448137
...
72ab1b1d13
3 changed files with 3 additions and 28 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,3 +1,2 @@
|
||||||
*.pyc
|
*.pyc
|
||||||
*.swp
|
*.swp
|
||||||
*.swo
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ class Command(BaseCommand):
|
||||||
for e in item.models.Item.objects.filter(data__title=i.data['title']):
|
for e in item.models.Item.objects.filter(data__title=i.data['title']):
|
||||||
if 'type' not in e.data:
|
if 'type' not in e.data:
|
||||||
print("ignoring invalid video", e)
|
print("ignoring invalid video", e)
|
||||||
source = e.files.filter(selected=True)[0].data.path
|
source = e.files.all()[0].data.path
|
||||||
ext = os.path.splitext(source)[1]
|
ext = os.path.splitext(source)[1]
|
||||||
type_ = e.data['type'][0].lower()
|
type_ = e.data['type'][0].lower()
|
||||||
target = os.path.join(prefix, type_, i.data['title'] + ext)
|
target = os.path.join(prefix, type_, i.data['title'] + ext)
|
||||||
|
|
@ -35,7 +35,7 @@ class Command(BaseCommand):
|
||||||
os.unlink(target)
|
os.unlink(target)
|
||||||
os.symlink(source, target)
|
os.symlink(source, target)
|
||||||
clip[type_] = target
|
clip[type_] = target
|
||||||
durations.append(e.files.filter(selected=True)[0].duration)
|
durations.append(e.files.all()[0].duration)
|
||||||
clip["duration"] = min(durations)
|
clip["duration"] = min(durations)
|
||||||
clip['tags'] = i.data.get('tags', [])
|
clip['tags'] = i.data.get('tags', [])
|
||||||
clip['editingtags'] = i.data.get('editingtags', [])
|
clip['editingtags'] = i.data.get('editingtags', [])
|
||||||
|
|
@ -52,7 +52,7 @@ class Command(BaseCommand):
|
||||||
data__type__contains="Voice Over",
|
data__type__contains="Voice Over",
|
||||||
):
|
):
|
||||||
fragment_id = int(vo.get('title').split('_')[0])
|
fragment_id = int(vo.get('title').split('_')[0])
|
||||||
source = vo.files.filter(selected=True)[0]
|
source = vo.files.all()[0]
|
||||||
batch = vo.get('batch')[0].replace('Text-', '')
|
batch = vo.get('batch')[0].replace('Text-', '')
|
||||||
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)
|
||||||
|
|
|
||||||
24
utils.py
24
utils.py
|
|
@ -1,24 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
def upgrade_originals():
|
|
||||||
import item.models
|
|
||||||
import itemlist.models
|
|
||||||
nt = itemlist.models.List.objects.get(name='No Type')
|
|
||||||
for i in nt.get_items(nt.user):
|
|
||||||
orig = item.models.Item.objects.get(data__title=i.get('title'), data__type=["Original"])
|
|
||||||
print(i, orig)
|
|
||||||
orig.files.all().update(selected=False)
|
|
||||||
i.files.all().update(item=orig)
|
|
||||||
orig.save()
|
|
||||||
orig.remove_poster()
|
|
||||||
orig.make_poster()
|
|
||||||
i.data['type'] = ['Empty']
|
|
||||||
i.save()
|
|
||||||
|
|
||||||
|
|
||||||
def remove_deselected_files():
|
|
||||||
il = itemlist.models.List.objects.get(name='New Originals')
|
|
||||||
for i in il.items.all():
|
|
||||||
for f in i.files.filter(selected=False):
|
|
||||||
f.data.delete()
|
|
||||||
f.delete()
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue