From d2e45ccbc9e4a7f90bd3765b3361366711e20512 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 13 Jan 2026 12:09:41 +0000 Subject: [PATCH 1/2] original -> source --- render.py | 28 ++++++++++++++-------------- scripts/poster.py | 10 +++++----- static/js/infoView.p_for_power.js | 12 ++++++------ 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/render.py b/render.py index 6067ea4..b2e8498 100644 --- a/render.py +++ b/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) diff --git a/scripts/poster.py b/scripts/poster.py index 8009319..65b87fc 100755 --- a/scripts/poster.py +++ b/scripts/poster.py @@ -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 diff --git a/static/js/infoView.p_for_power.js b/static/js/infoView.p_for_power.js index ad70b06..735b30f 100644 --- a/static/js/infoView.p_for_power.js +++ b/static/js/infoView.p_for_power.js @@ -292,7 +292,7 @@ pandora.ui.infoView = function(data, isMixed) { if (data.type?.join('').includes('ai:')) { $('
').addClass('ai-preview').appendTo($text); } - if (data.type?.includes('original')) { + if (data.type?.includes('source')) { $('').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( ` ${type}` ) - if (type == 'original') { - original = item.id + if (type == 'source') { + source = item.id } } }) $element.append(`[all]`) 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 = ` From fea9e04e8b17dac528d8f188df1a2b5d01c7c84a Mon Sep 17 00:00:00 2001 From: j Date: Tue, 13 Jan 2026 12:10:12 +0000 Subject: [PATCH 2/2] tab > space --- static/js/infoView.p_for_power.js | 68 +++++++++++++++---------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/static/js/infoView.p_for_power.js b/static/js/infoView.p_for_power.js index 735b30f..9ccebb7 100644 --- a/static/js/infoView.p_for_power.js +++ b/static/js/infoView.p_for_power.js @@ -669,44 +669,44 @@ pandora.ui.infoView = function(data, isMixed) { $element.append( ` ${type}` ) - if (type == 'source') { - source = item.id - } + if (type == 'source') { + source = item.id + } } }) $element.append(`[all]`) pandora.createLinks($element) - if (data.type?.join('').includes('ai:') && source) { - const preview = $text[0].querySelector('.ai-preview') - const src_ai = '480p.mp4' - const src = `/${source}/480p.mp4` - preview.innerHTML = ` - - - - ` - preview.querySelectorAll('video').forEach(video => { - video.addEventListener('play', event => { - preview.querySelectorAll('video').forEach(v => { - if (v != video) { - v.currentTime = video.currentTime - v.play() - } - }) - }) - video.addEventListener('pause', event => { - preview.querySelectorAll('video').forEach(v => { - if (v != video) { - v.pause() - } - }) - }) - }) - } + if (data.type?.join('').includes('ai:') && source) { + const preview = $text[0].querySelector('.ai-preview') + const src_ai = '480p.mp4' + const src = `/${source}/480p.mp4` + preview.innerHTML = ` + + + + ` + preview.querySelectorAll('video').forEach(video => { + video.addEventListener('play', event => { + preview.querySelectorAll('video').forEach(v => { + if (v != video) { + v.currentTime = video.currentTime + v.play() + } + }) + }) + video.addEventListener('pause', event => { + preview.querySelectorAll('video').forEach(v => { + if (v != video) { + v.pause() + } + }) + }) + }) + } }) }