From 6b148c4e4e044c56caad6deacd92ab260315e9d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Henrique?= Date: Thu, 10 Sep 2026 19:39:33 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20permitido=20testar=20plano=20somente=20?= =?UTF-8?q?com=20zoom=20reconstruindo=20a=20m=C3=ADdi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - permitido testar plano somente com zoom reconstruindo a mídia completa antes da camada de ajuste Resumo: - 1 arquivos alterados - 0 novos - 1 modificados - 0 removidos 1 file changed, 18 insertions(+), 6 deletions(-) Arquivos: - code/engine/aplicar_montagem_incremental_prototipo.py --- .../aplicar_montagem_incremental_prototipo.py | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/code/engine/aplicar_montagem_incremental_prototipo.py b/code/engine/aplicar_montagem_incremental_prototipo.py index ef30c1f..4ee2836 100644 --- a/code/engine/aplicar_montagem_incremental_prototipo.py +++ b/code/engine/aplicar_montagem_incremental_prototipo.py @@ -52,6 +52,13 @@ def preparar_intervalos( for acao in plano["actions"] if isinstance(acao, dict) and acao.get("kind") in {"cut", "hook"} ] + if not acoes: + return [{ + "in_seconds": 0.0, + "out_seconds": duracao_da_midia, + "destination_seconds": 0.0, + "label": "mídia completa", + }] insercoes = PlanejadorDeMontagemIncremental(duracao_da_midia).planejar(acoes) return [ { @@ -86,20 +93,25 @@ def executar(caminho_do_plano: Path) -> dict[str, object]: }, ) if plano.get("test_adjustment_layer") is True: - gancho = next( + alvo = next( ( acao for acao in plano["actions"] - if isinstance(acao, dict) and acao.get("kind") == "hook" + if isinstance(acao, dict) and acao.get("kind") in {"hook", "zoom"} ), None, ) - if gancho is None: + if alvo is None: raise ErroDeMontagemIncremental( - "O teste da adjustment layer exige uma ação hook no plano." + "O teste da adjustment layer exige uma ação hook ou zoom no plano." ) - inicio_do_gancho = 0.0 - fim_do_gancho = float(gancho["end"]) - float(gancho["start"]) + eh_gancho = alvo.get("kind") == "hook" + inicio_do_gancho = 0.0 if eh_gancho else float(alvo["start"]) + fim_do_gancho = ( + float(alvo["end"]) - float(alvo["start"]) + if eh_gancho + else float(alvo["end"]) + ) camada = cliente.chamar( "insert_adjustment_layer_range", {