original -> source
This commit is contained in:
parent
34fa9e9262
commit
d2e45ccbc9
3 changed files with 25 additions and 25 deletions
28
render.py
28
render.py
|
|
@ -149,15 +149,15 @@ def compose(clips, target=150, base=1024, voice_over=None, options=None):
|
|||
break
|
||||
length += int(clip['duration'] * fps) / fps
|
||||
|
||||
# 50/50 original or ai
|
||||
src = clip['original']
|
||||
audio = clip['original']
|
||||
# 50/50 source or ai
|
||||
src = clip['source']
|
||||
audio = clip['source']
|
||||
# select ai if we have one
|
||||
if 'ai' in clip:
|
||||
if True or chance(seq, 0.5):
|
||||
src = random_choice(seq, list(clip['ai'].values()), False)
|
||||
|
||||
print('%07.3f %07.3f' % (length, clip['duration']), src.split('/')[-2], os.path.basename(clip['original']))
|
||||
print('%07.3f %07.3f' % (length, clip['duration']), src.split('/')[-2], os.path.basename(clip['source']))
|
||||
|
||||
scene['front']['V2'].append({
|
||||
'duration': clip['duration'],
|
||||
|
|
@ -298,7 +298,7 @@ def get_fragments(clips, voice_over, prefix):
|
|||
fragment['anti-tags'].append(con['value'])
|
||||
|
||||
fragment["id"] = int(fragment['name'].split(' ')[0])
|
||||
originals = []
|
||||
sources = []
|
||||
for i in l.get_items(l.user):
|
||||
orig = i.files.filter(selected=True).first()
|
||||
if orig:
|
||||
|
|
@ -308,13 +308,13 @@ def get_fragments(clips, voice_over, prefix):
|
|||
continue
|
||||
type_ = i.data['type'][0].lower()
|
||||
target = os.path.join(prefix, type_, i.data['title'] + ext)
|
||||
originals.append(target)
|
||||
sources.append(target)
|
||||
fragment['clips'] = []
|
||||
for clip in clips:
|
||||
#if set(clip['tags']) & set(fragment['tags']) and not set(clip['tags']) & set(fragment['anti-tags']):
|
||||
key = 'original'
|
||||
original = clip['original']
|
||||
if original in originals:
|
||||
key = 'source'
|
||||
source = clip['source']
|
||||
if source in sources:
|
||||
fragment['clips'].append(clip)
|
||||
fragment["voice_over"] = voice_over.get(str(fragment["id"]), {})
|
||||
fragments.append(fragment)
|
||||
|
|
@ -777,8 +777,8 @@ def generate_clips(options):
|
|||
prefix = options['prefix']
|
||||
lang, tlang = parse_lang(options["lang"])
|
||||
clips = []
|
||||
for i in item.models.Item.objects.filter(sort__type='original'):
|
||||
original_target = ""
|
||||
for i in item.models.Item.objects.filter(sort__type='source'):
|
||||
source_target = ""
|
||||
qs = item.models.Item.objects.filter(data__title=i.data['title']).exclude(id=i.id)
|
||||
#if qs.count() >= 1:
|
||||
if True:
|
||||
|
|
@ -798,8 +798,8 @@ def generate_clips(options):
|
|||
if os.path.islink(target):
|
||||
os.unlink(target)
|
||||
os.symlink(source, target)
|
||||
if type_ == "original":
|
||||
original_target = target
|
||||
if type_ == "source":
|
||||
source_target = target
|
||||
if type_.startswith('ai:'):
|
||||
if 'ai' not in clip:
|
||||
clip['ai'] = {}
|
||||
|
|
@ -815,7 +815,7 @@ def generate_clips(options):
|
|||
clip["duration"] = cd
|
||||
clip['tags'] = i.data.get('tags', [])
|
||||
clip['id'] = i.public_id
|
||||
name = os.path.basename(original_target)
|
||||
name = os.path.basename(source_target)
|
||||
seqid = re.sub(r"Hotel Aporia_(\d+)", "S\\1_", name)
|
||||
seqid = re.sub(r"Night March_(\d+)", "S\\1_", seqid)
|
||||
seqid = re.sub(r"_(\d+)H_(\d+)", "_S\\1\\2_", seqid)
|
||||
|
|
|
|||
|
|
@ -36,15 +36,15 @@ def render_poster(data, poster):
|
|||
type = data.get('type')
|
||||
if type:
|
||||
type = data.get('type')[0].lower()
|
||||
if type == "original":
|
||||
if type == "source":
|
||||
i = 0
|
||||
elif type == "background":
|
||||
elif type and type.startswith('ai:'):
|
||||
i = 200
|
||||
elif type == "foreground":
|
||||
elif type == "landscape":
|
||||
i = 400
|
||||
elif type == "foreground2":
|
||||
elif type == "music":
|
||||
i = 500
|
||||
elif type == "annimation":
|
||||
elif type == "audio":
|
||||
i = 600
|
||||
elif type == "voice over":
|
||||
i = 300
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ pandora.ui.infoView = function(data, isMixed) {
|
|||
if (data.type?.join('').includes('ai:')) {
|
||||
$('<div>').addClass('ai-preview').appendTo($text);
|
||||
}
|
||||
if (data.type?.includes('original')) {
|
||||
if (data.type?.includes('source')) {
|
||||
|
||||
$('<a>').attr({
|
||||
href: 'https://power-video.rmozone.com/#ox/' + data.id,
|
||||
|
|
@ -659,7 +659,7 @@ pandora.ui.infoView = function(data, isMixed) {
|
|||
};
|
||||
$element.appendTo($text);
|
||||
pandora.api.find(request, function(response) {
|
||||
let original;
|
||||
let source;
|
||||
response.data.items.forEach(item => {
|
||||
if (item.id != data.id) {
|
||||
var type = item.type ? item.type[0] : 'Unknown'
|
||||
|
|
@ -669,17 +669,17 @@ pandora.ui.infoView = function(data, isMixed) {
|
|||
$element.append(
|
||||
` <a href="/${item.id}/info">${type}</a>`
|
||||
)
|
||||
if (type == 'original') {
|
||||
original = item.id
|
||||
if (type == 'source') {
|
||||
source = item.id
|
||||
}
|
||||
}
|
||||
})
|
||||
$element.append(`[<a href="/grid/title/title=${pandora.escapeQueryValue(title)}">all</a>]`)
|
||||
pandora.createLinks($element)
|
||||
if (data.type?.join('').includes('ai:') && original) {
|
||||
if (data.type?.join('').includes('ai:') && source) {
|
||||
const preview = $text[0].querySelector('.ai-preview')
|
||||
const src_ai = '480p.mp4'
|
||||
const src = `/${original}/480p.mp4`
|
||||
const src = `/${source}/480p.mp4`
|
||||
preview.innerHTML = `
|
||||
<video src="${src}" controls loop></video>
|
||||
<video src="${src_ai}" loop></video>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue