From a4286bbd8acd65fbffc2102e1b54ef9d9debeaed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Henrique?= Date: Thu, 10 Sep 2026 13:22:15 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20definido=20projeto=20com=20uma=20sequ?= =?UTF-8?q?=C3=AAncia=20e=20m=C3=BAltiplos=20arquivos=20de=20m?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - definido projeto com uma sequência e múltiplos arquivos de mídia - criada persistência de projeto com uma sequência e seleções de faixas e clipes - criada guia Projeto para selecionar sequência, faixas e clipes do Premiere - adicionada gravação das seleções da guia Projeto no SQLite Resumo: - 10 arquivos alterados - 4 novos - 6 modificados - 0 removidos 6 files changed, 71 insertions(+), 2 deletions(-) Arquivos: - .jhonny/analises.db - CONTEXT.md - code/cep-plugin/index.html - code/cep-plugin/main.js - code/engine/persistencia/__init__.py - code/engine/persistencia/esquema.py - code/cep-plugin/abas/ - code/engine/persistencia/repositorio_de_projetos.py - code/engine/registrar_projeto_de_edicao.py - code/engine/testes/test_repositorio_de_projetos.py --- .jhonny/analises.db | Bin 1085440 -> 1089536 bytes CONTEXT.md | 3 + code/cep-plugin/abas/projeto/projeto.js | 100 ++++++++++++++++++ code/cep-plugin/index.html | 35 +++++- code/cep-plugin/main.js | 5 +- code/engine/persistencia/__init__.py | 4 + code/engine/persistencia/esquema.py | 26 +++++ .../persistencia/repositorio_de_projetos.py | 79 ++++++++++++++ code/engine/registrar_projeto_de_edicao.py | 48 +++++++++ .../testes/test_repositorio_de_projetos.py | 31 ++++++ 10 files changed, 329 insertions(+), 2 deletions(-) create mode 100644 code/cep-plugin/abas/projeto/projeto.js create mode 100644 code/engine/persistencia/repositorio_de_projetos.py create mode 100644 code/engine/registrar_projeto_de_edicao.py create mode 100644 code/engine/testes/test_repositorio_de_projetos.py diff --git a/.jhonny/analises.db b/.jhonny/analises.db index 766e6178a1c3cc02ded2e979f20650de8aad45b3..f3dbc6c7af87a3a57034ced4844bce909ff905e2 100644 GIT binary patch delta 208 zcmZoz;M8!yX@az%Gy?-87Xut{JfEmz%qYDvA#Ob*OY{Eq?fcg=Zr{J2$u)tGng1hD z86y|}Z~kxmA2%x+ykXn^PmK992P;sNleztyJP5M@F)I+W0Wmuea{w_X5OV=BHxTn| z|0d7NH-U$R?;fRvj8zG5VHX>I}n4!If0l9h`E87XZtsKUcL!D z%>332{QLQ9fz= 0 ? ativa : 0; + projetoSelecionarSequencia(); + } else { + info.textContent = "Nenhuma sequência encontrada no projeto do Premiere."; + } + } + ); +} + +function projetoSelecionarSequencia() { + var select = document.getElementById("projetoSequenciaSelect"); + projetoAtual = projetoSequencias.find(function (item) { return item.id === select.value; }) || null; + if (!projetoAtual) return; + document.getElementById("projetoTimelineCard").hidden = false; + document.getElementById("projetoStatus").textContent = "Sequência selecionada"; + document.getElementById("projetoTimelineStatus").textContent = projetoAtual.nome; + document.getElementById("projetoDuracao").textContent = formatSequenceDuration(projetoAtual.duracao); + document.getElementById("projetoResolucao").textContent = projetoAtual.largura && projetoAtual.altura ? projetoAtual.largura + " × " + projetoAtual.altura : "Não informada"; + document.getElementById("projetoTotalFaixas").textContent = projetoAtual.faixas.length; + document.getElementById("projetoTotalClipes").textContent = projetoAtual.faixas.reduce(function (total, faixa) { return total + faixa.clipes.length; }, 0); + var container = document.getElementById("projetoFaixas"); + container.innerHTML = ""; + projetoAtual.faixas.forEach(function (faixa) { + var bloco = document.createElement("div"); + bloco.className = "scanner-subsection"; + bloco.innerHTML = '"; + faixa.clipes.forEach(function (clipe) { + bloco.innerHTML += '"; + }); + container.appendChild(bloco); + }); + document.getElementById("btnProjetoContinuar").disabled = false; + document.getElementById("btnProjetoSalvar").disabled = false; + document.getElementById("projetoInfo").textContent = "A sequência foi carregada. Selecione as faixas e clipes que participarão do plano."; +} + +function projetoSalvar() { + if (!projetoAtual) return; + var faixas = Array.prototype.slice.call(document.querySelectorAll("[data-projeto-faixa]:checked")).map(function (item) { return item.getAttribute("data-projeto-faixa"); }); + var clipes = Array.prototype.slice.call(document.querySelectorAll("[data-projeto-clipe]:checked")).map(function (item) { return item.getAttribute("data-projeto-clipe"); }); + var pedido = path.join(os.tmpdir(), "pedido-projeto-edicao-" + Date.now() + ".json"); + fs.writeFileSync(pedido, JSON.stringify({ + nome: projetoAtual.nome, video_id: projetoAtual.id, faixas: faixas, clipes: clipes, + }, null, 2), "utf-8"); + setBusy("btnProjetoSalvar", true); + runStreamed(SCANNER_PYTHON_BIN, [REGISTRAR_PROJETO_SCRIPT, pedido, "--banco", ANALISES_DB_PATH], + function (linha) { silenceLog(linha); }, + function (codigo, ultimoErro) { + setBusy("btnProjetoSalvar", false); + if (codigo !== 0) { showToast("err", ultimoErro || "Não foi possível salvar o projeto."); return; } + document.getElementById("projetoStatus").textContent = "Projeto salvo no banco"; + showToast("ok", "Projeto salvo com " + faixas.length + " faixa(s) e " + clipes.length + " clipe(s)."); + }); +} + +function projetoContinuarEdicao() { + if (!projetoAtual) return; + switchTab("silence"); + silenceListSequences(); +} diff --git a/code/cep-plugin/index.html b/code/cep-plugin/index.html index 5f15ac9..b7e39f1 100755 --- a/code/cep-plugin/index.html +++ b/code/cep-plugin/index.html @@ -28,7 +28,10 @@