diff --git a/.jhonny/analises.db b/.jhonny/analises.db index f3dbc6c..3224e6a 100644 Binary files a/.jhonny/analises.db and b/.jhonny/analises.db differ diff --git a/code/cep-plugin/abas/projeto/projeto.js b/code/cep-plugin/abas/projeto/projeto.js index 78336af..861e40b 100644 --- a/code/cep-plugin/abas/projeto/projeto.js +++ b/code/cep-plugin/abas/projeto/projeto.js @@ -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"); }); diff --git a/code/cep-plugin/index.html b/code/cep-plugin/index.html index b7e39f1..c7b855e 100755 --- a/code/cep-plugin/index.html +++ b/code/cep-plugin/index.html @@ -111,6 +111,11 @@
Faixas
—
Clipes
—
+ + +

O tipo definido na edição concluída será carregado do banco.

Faixas e clipes utilizados

@@ -123,20 +128,19 @@