feat: carregamento automático da análise do Scanner ao abrir a aba
- carregamento automático da análise do Scanner ao abrir a aba Refinar - simplificada a aba Editar vídeo para exibir análises disponíveis sem carregamento manual - movida a visualização do tipo de vídeo para a guia Projeto com leitura do banco Resumo: - 10 arquivos alterados - 2 novos - 8 modificados - 0 removidos 8 files changed, 114 insertions(+), 11 deletions(-) Arquivos: - .jhonny/analises.db - code/cep-plugin/abas/projeto/projeto.js - code/cep-plugin/index.html - code/cep-plugin/main.js - code/engine/integracoes/audio/__init__.py - code/engine/integracoes/audio/modelos_de_analise_musical.py - code/engine/integracoes/audio/provider_de_analise_musical_essentia.py - code/engine/testes/test_analisador_de_musica_essentia.py - code/engine/consultar_edicao_concluida.py - code/engine/integracoes/audio/classificador_de_musica_essentia.py
This commit is contained in:
@@ -71,9 +71,51 @@ function projetoSelecionarSequencia() {
|
||||
});
|
||||
document.getElementById("btnProjetoContinuar").disabled = false;
|
||||
document.getElementById("btnProjetoSalvar").disabled = false;
|
||||
projetoCarregarTipoDeVideo();
|
||||
document.getElementById("projetoInfo").textContent = "A sequência foi carregada. Selecione as faixas e clipes que participarão do plano.";
|
||||
}
|
||||
|
||||
function projetoCarregarTipoDeVideo() {
|
||||
var select = document.getElementById("projetoTipoVideoSelect");
|
||||
var info = document.getElementById("projetoTipoVideoInfo");
|
||||
select.disabled = true;
|
||||
runStreamed(SCANNER_PYTHON_BIN, [CONSULTAR_EDICAO_SCRIPT, projetoAtual.id, "--banco", ANALISES_DB_PATH],
|
||||
function () {},
|
||||
function (codigo, ultimoErro, ultimaSaida) {
|
||||
if (codigo !== 0) { info.textContent = ultimoErro || "Nenhum tipo de vídeo salvo para esta sequência."; return; }
|
||||
try {
|
||||
var edicao = JSON.parse(ultimaSaida).edicao;
|
||||
var tipos = tiposVideoLer().filter(function (item) { return item.ativo !== false; });
|
||||
var tipo = tipos.filter(function (item) { return item.id === edicao.tipo_de_video; })[0];
|
||||
select.innerHTML = "";
|
||||
tipos.forEach(function (item) {
|
||||
var opcao = document.createElement("option");
|
||||
opcao.value = item.id;
|
||||
opcao.textContent = item.nome;
|
||||
select.appendChild(opcao);
|
||||
});
|
||||
if (!tipo) {
|
||||
var tipoDesconhecido = document.createElement("option");
|
||||
tipoDesconhecido.value = edicao.tipo_de_video;
|
||||
tipoDesconhecido.textContent = edicao.tipo_de_video;
|
||||
select.appendChild(tipoDesconhecido);
|
||||
}
|
||||
select.value = edicao.tipo_de_video;
|
||||
select.disabled = false;
|
||||
silenceState.tipoVideoId = edicao.tipo_de_video;
|
||||
silenceState.tipoVideo = tipo || null;
|
||||
info.textContent = "Tipo carregado da edição concluída mais recente.";
|
||||
} catch (erro) { info.textContent = "Não foi possível interpretar o tipo salvo: " + erro.message; }
|
||||
});
|
||||
}
|
||||
|
||||
function projetoSelecionarTipoVideo() {
|
||||
var tipo = tiposVideoLer().filter(function (item) { return item.id === document.getElementById("projetoTipoVideoSelect").value; })[0] || null;
|
||||
silenceState.tipoVideoId = tipo ? tipo.id : null;
|
||||
silenceState.tipoVideo = tipo;
|
||||
document.getElementById("projetoTipoVideoInfo").textContent = tipo ? tipo.nome + " · disponível para a edição." : "Nenhum tipo selecionado.";
|
||||
}
|
||||
|
||||
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"); });
|
||||
|
||||
@@ -111,6 +111,11 @@
|
||||
<div><dt>Faixas</dt><dd id="projetoTotalFaixas">—</dd></div>
|
||||
<div><dt>Clipes</dt><dd id="projetoTotalClipes">—</dd></div>
|
||||
</dl>
|
||||
<label class="field-label" for="projetoTipoVideoSelect">Tipo de vídeo</label>
|
||||
<select id="projetoTipoVideoSelect" class="select-field" onchange="projetoSelecionarTipoVideo()" disabled>
|
||||
<option value="">Carregando tipo de vídeo…</option>
|
||||
</select>
|
||||
<p class="field-help" id="projetoTipoVideoInfo">O tipo definido na edição concluída será carregado do banco.</p>
|
||||
<h3>Faixas e clipes utilizados</h3>
|
||||
<div id="projetoFaixas" class="scanner-track-list"></div>
|
||||
<div class="button-row">
|
||||
@@ -123,20 +128,19 @@
|
||||
<!-- ============================= EDITAR VÍDEO ============================= -->
|
||||
<div class="tab-panel" id="tabSilence" role="tabpanel" aria-labelledby="tabBtnSilence" hidden>
|
||||
|
||||
<p class="tab-intro">A edição usa a análise já concluída pelo Scanner. Selecione o tipo de vídeo e conclua para salvar a configuração no banco.</p>
|
||||
<p class="tab-intro">Os dados analisados e o tipo de vídeo definidos no Projeto já estão disponíveis para esta edição.</p>
|
||||
|
||||
<section class="card scanner-analysis-card" id="scannerAnalysisCard">
|
||||
<div class="card-head"><h2>Análise do Scanner</h2><span class="step-chip" id="scannerAnalysisStatus">Não carregada</span></div>
|
||||
<p class="field-help" id="scannerAnalysisInfo">Carregue a análise mais recente do Scanner antes de concluir a edição.</p>
|
||||
<p class="field-help" id="scannerAnalysisInfo">A análise mais recente da sequência será carregada automaticamente.</p>
|
||||
<ul class="scanner-analysis-checks" id="scannerAnalysisChecks" aria-label="Componentes carregados da análise">
|
||||
<li id="scannerCheckTranscription" data-state="pending"><span class="check-dot" aria-hidden="true"></span><span>Transcrição</span><em>Aguardando</em></li>
|
||||
<li id="scannerCheckDiarization" data-state="pending"><span class="check-dot" aria-hidden="true"></span><span>Detecção de falantes</span><em>Aguardando</em></li>
|
||||
<li id="scannerCheckVoiceFeatures" data-state="pending"><span class="check-dot" aria-hidden="true"></span><span>Métrica de voz</span><em>Aguardando</em></li>
|
||||
</ul>
|
||||
<button id="btnLoadScannerAnalysis" class="button button-primary" onclick="silenceLoadScannerAnalysis()" type="button">Carregar análise do Scanner</button>
|
||||
</section>
|
||||
|
||||
<section class="step" id="step1" data-state="locked">
|
||||
<section class="step" id="step1" data-state="locked" hidden>
|
||||
<div class="step-head">
|
||||
<span class="step-number" aria-hidden="true">1</span>
|
||||
<div class="step-title">
|
||||
@@ -297,7 +301,7 @@
|
||||
<div class="card-head"><h2>Falantes da análise</h2><span class="step-chip" id="refinarStatus">Aguardando análise</span></div>
|
||||
<p class="field-help" id="refinarInfo">Carregue a análise mais recente do Scanner para consultar os falantes detectados.</p>
|
||||
<div class="refinar-actions">
|
||||
<button id="btnRefinarLoad" class="button button-primary" onclick="refinarCarregarAnalise()" type="button">Carregar análise do Scanner</button>
|
||||
<button id="btnRefinarLoad" class="button button-ghost" onclick="refinarCarregarAnalise()" type="button">Recarregar análise do Scanner</button>
|
||||
<button id="btnRefinarStopAudio" class="button" onclick="stopSpeakerAudio()" type="button">Parar preview</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -950,6 +950,7 @@ var ANALISE_PREVIEW_SCRIPT = "/Volumes/Merongo/SISTEMAS/GENIAL SISTEMAS/Jhonny/c
|
||||
var REGISTRAR_EDICAO_SCRIPT = "/Volumes/Merongo/SISTEMAS/GENIAL SISTEMAS/Jhonny/code/engine/registrar_edicao.py";
|
||||
var CARREGAR_PLANO_SCRIPT = "/Volumes/Merongo/SISTEMAS/GENIAL SISTEMAS/Jhonny/code/engine/carregar_plano_de_edicao.py";
|
||||
var REGISTRAR_PROJETO_SCRIPT = "/Volumes/Merongo/SISTEMAS/GENIAL SISTEMAS/Jhonny/code/engine/registrar_projeto_de_edicao.py";
|
||||
var CONSULTAR_EDICAO_SCRIPT = "/Volumes/Merongo/SISTEMAS/GENIAL SISTEMAS/Jhonny/code/engine/consultar_edicao_concluida.py";
|
||||
var planoEditorialIdCarregado = null;
|
||||
var retakesCasoAtual = null;
|
||||
var retakesGrupos = [];
|
||||
@@ -2415,10 +2416,16 @@ function silenceLoadScannerAnalysis() {
|
||||
|
||||
function refinarAoAbrir() {
|
||||
var info = document.getElementById("refinarInfo");
|
||||
if (!info || !silenceState.sequenceId) return;
|
||||
if (!info) return;
|
||||
if (!silenceState.sequenceId || !silenceState.transcriptPath) {
|
||||
silenceLoadScannerAnalysis();
|
||||
return;
|
||||
}
|
||||
info.textContent = silenceState.sequenceName + " · " + (silenceState.speakers.length
|
||||
? silenceState.speakers.length + " falante(s) carregado(s)."
|
||||
: "Nenhum falante carregado.");
|
||||
var botao = document.getElementById("btnRefinarLoad");
|
||||
if (botao) botao.textContent = "Recarregar análise do Scanner";
|
||||
}
|
||||
|
||||
function refinarCarregarAnalise() {
|
||||
|
||||
Reference in New Issue
Block a user