editing
This commit is contained in:
parent
9bd5d12874
commit
d4b23ff844
1 changed files with 20 additions and 7 deletions
27
render.py
27
render.py
|
|
@ -427,7 +427,7 @@ def get_fragments(clips, voice_over, prefix):
|
|||
print(l.name, 'unknown sub condition', sub)
|
||||
elif con.get('key') == "tags" and con['operator'] == '==':
|
||||
fragment['tags'].append(con['value'].lower().strip())
|
||||
elif con.get('key') == "tags" and con['operator'] == '!=':
|
||||
elif con.get('key') == "tags" and con['operator'] == '!==':
|
||||
fragment['anti-tags'].append(con['value'].lower().strip())
|
||||
|
||||
fragment["id"] = int(fragment['name'].split(' ')[0])
|
||||
|
|
@ -933,7 +933,14 @@ def generate_clips(options):
|
|||
prefix = options['prefix']
|
||||
lang, tlang = parse_lang(options["lang"])
|
||||
clips = []
|
||||
remove_from_edit = itemlist.models.List.objects.filter(name='Remove from Edit').first()
|
||||
if remove_from_edit:
|
||||
skip = [i.public_id for i in remove_from_edit.get_items(remove_from_edit.user).all()]
|
||||
else:
|
||||
skip = []
|
||||
for i in item.models.Item.objects.filter(sort__type='source'):
|
||||
if i.public_id in skip:
|
||||
continue
|
||||
source_target = ""
|
||||
qs = item.models.Item.objects.filter(data__title=i.data['title']).exclude(id=i.id)
|
||||
#if qs.count() >= 1:
|
||||
|
|
@ -943,6 +950,8 @@ def generate_clips(options):
|
|||
for e in item.models.Item.objects.filter(data__title=i.data['title']):
|
||||
if 'skip' in e.data.get('tags', []):
|
||||
continue
|
||||
if e.public_id in skip:
|
||||
continue
|
||||
if 'type' not in e.data:
|
||||
print("ignoring invalid video %s (no type)" % e)
|
||||
continue
|
||||
|
|
@ -1116,7 +1125,7 @@ def update_unused():
|
|||
x = render_stats(folder)
|
||||
used += x['source']
|
||||
used += x['ai']
|
||||
for i in Item.objects.all().exclude(public_id__in=set(used)).filter(data__type__icontains='source'):
|
||||
for i in item.models.Item.objects.all().exclude(public_id__in=set(used)).filter(data__type__icontains='source'):
|
||||
l.add(i)
|
||||
for i in l.items.filter(public_id__in=set(used)):
|
||||
l.remove(i)
|
||||
|
|
@ -1143,9 +1152,13 @@ def unused_tags():
|
|||
all_tags = {t.value.strip().lower() for t in item.models.Facet.objects.filter(key='tags').distinct()}
|
||||
unused_tags = all_tags - used_tags - used_anti_tags
|
||||
unused_items = itemlist.models.List.objects.get(name='Unused Material').items.all()
|
||||
|
||||
unused = []
|
||||
for tag in sorted(unused_tags):
|
||||
count = unused_items.filter(data__tags__icontains=tag).count()
|
||||
unused.append([count, tag])
|
||||
with open("/srv/pandora/static/power/unused-tags.txt", "w") as fd:
|
||||
for tag in sorted(unused_tags):
|
||||
count = unused_items.filter(data__tags__contains=tag).count()
|
||||
for count, tag in reversed(sorted(unused)):
|
||||
fd.write("%s (%d unused video clips)\n" % (tag, count))
|
||||
|
||||
def fragment_statistics():
|
||||
|
|
@ -1167,15 +1180,15 @@ def fragment_statistics():
|
|||
for sub in con["conditions"]:
|
||||
if sub['key'] == "tags" and sub['operator'] == '==':
|
||||
fragment['tags'].append(sub['value'].lower().strip())
|
||||
elif sub['key'] == "tags" and sub['operator'] == '!=':
|
||||
fragment['tags'].append(sub['value'].lower().strip())
|
||||
elif sub['key'] == "tags" and sub['operator'] == '!==':
|
||||
fragment['anti-tags'].append(sub['value'].lower().strip())
|
||||
elif sub['key'] == 'type' and sub['value'] in ('source', ''):
|
||||
pass
|
||||
else:
|
||||
print(l.name, 'unknown sub condition', sub)
|
||||
elif con.get('key') == "tags" and con['operator'] == '==':
|
||||
fragment['tags'].append(con['value'].lower().strip())
|
||||
elif con.get('key') == "tags" and con['operator'] == '!=':
|
||||
elif con.get('key') == "tags" and con['operator'] == '!==':
|
||||
fragment['anti-tags'].append(con['value'].lower().strip())
|
||||
|
||||
if fragment_id not in stats:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue