Skip to content

Commit 33d6f70

Browse files
committed
fix: batch 28 — 40+ audit fixes for v1.5.0 new code
Core modules: - chapter_gen: non-greedy JSON regex truncated LLM arrays (same class as highlights batch 5 fix), input validation on max_chapters - nlp_command: greedy JSON regex for nested params, route allowlist validation on LLM output, word-boundary keyword matching (prevents "um" matching "volume"), confidence float coercion safety - color_match: VideoWriter.isOpened() check, on_progress(100) at end, use consolidated run_ffmpeg helper, fix YCrCb channel label order - auto_zoom: VideoCapture try/finally for resource safety, fix easing no-op (_ease(1.0) always returned 1.0), negative fps guard - loudness_match: use consolidated helper, pass 1 returncode check, validate measured values as floats, clamp target_lufs/true_peak - footage_search: Windows LK_LOCK (was LK_NBLCK), explicit unlock - multicam: float coercion on start/end, .get() for safe access - deliverables: round(fps) instead of int(fps) for fractional FPS Routes: - nlp: guard parse_command() returning None, LLM provider allowlist - timeline: safe_float instead of float() on SRT segment pass-through - captions: import sort fix for ruff compliance Infrastructure: - checks.py: consistent bool return types (was Tuple breaking callers) - user_data.py: remove lock eviction (thread-safety violation) - cli.py: fix chapters dict access (.get not .attribute), fix repeat-detect dict result handling, fix search index/query imports (footage_search.index_file not search.index_files) UXP Panel (5 P0 crash fixes — panel was completely non-functional): - CSRF header: X-CSRF-Token -> X-OpenCut-Token - CSRF acquisition: /csrf endpoint -> /health csrf_token field - Job polling: /jobs/{id} -> /status/{id} - Job cancel: DELETE /jobs/{id} -> POST /cancel/{id} - LLM settings: BackendClient.fetch() -> BackendClient.get() - Version sync to v1.5.1, whisper model selector updated ExtendScript: - Smart bins "video" type now matches AV files (was excluding them) - Temp SRT file cleanup after caption import
1 parent c51bfd9 commit 33d6f70

34 files changed

Lines changed: 230 additions & 160 deletions

Install.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Write-Host " \___/| .__/ \___|_| |_|\____\__,_|\__|" -ForegroundColor Cyan
155155
Write-Host " |_| " -ForegroundColor Cyan
156156
Write-Host ""
157157
Write-Host " Open Source Video Editing Automation" -ForegroundColor DarkGray
158-
Write-Host " Installer v1.4.0" -ForegroundColor DarkGray
158+
Write-Host " Installer v1.5.1" -ForegroundColor DarkGray
159159

160160
$isAdmin = Test-IsAdmin
161161
if ($isAdmin) {

OpenCut.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; Fully self-contained installer — bundles server exe, ffmpeg, and CEP extension
33

44
#define MyAppName "OpenCut"
5-
#define MyAppVersion "1.4.0"
5+
#define MyAppVersion "1.5.1"
66
#define MyAppPublisher "SysAdminDoc"
77
#define MyAppURL "https://github.com/SysAdminDoc/OpenCut"
88

extension/com.opencut.panel/CSXS/manifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<ExtensionManifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
Version="7.0"
44
ExtensionBundleId="com.opencut.panel"
5-
ExtensionBundleVersion="1.5.0"
5+
ExtensionBundleVersion="1.5.1"
66
ExtensionBundleName="OpenCut">
77

88
<ExtensionList>
9-
<Extension Id="com.opencut.panel.main" Version="1.5.0" />
9+
<Extension Id="com.opencut.panel.main" Version="1.5.1" />
1010
</ExtensionList>
1111

1212
<ExecutionEnvironment>

extension/com.opencut.panel/client/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2943,7 +2943,7 @@ <h1 class="content-title" id="contentTitle">Cut & Clean</h1>
29432943
<div class="card-header"><div class="card-title">About OpenCut</div></div>
29442944
<div class="settings-row">
29452945
<span class="settings-label">Version</span>
2946-
<span class="settings-value">1.5.0</span>
2946+
<span class="settings-value">1.5.1</span>
29472947
</div>
29482948
<div class="about-links">
29492949
<a href="https://github.com/SysAdminDoc/opencut" class="about-link" target="_blank">GitHub</a>

extension/com.opencut.panel/client/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ============================================================
2-
OpenCut CEP Panel - Main Controller v1.4.0
2+
OpenCut CEP Panel - Main Controller v1.5.1
33
6-Tab Professional Toolkit
44
============================================================ */
55
(function () {

extension/com.opencut.panel/client/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ============================================================
2-
OpenCut CEP Panel v1.4.0 - ULTRA PREMIUM EDITION
2+
OpenCut CEP Panel v1.5.1 - ULTRA PREMIUM EDITION
33
Next-Generation AI Editing Suite for Adobe Premiere Pro
44
============================================================ */
55

extension/com.opencut.panel/host/index.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,9 +1939,9 @@ function ocCreateSmartBins(rulesJSON) {
19391939
try { hasVid = mediaItem.hasVideo(); } catch (e) {}
19401940
try { hasAud = mediaItem.hasAudio(); } catch (e) {}
19411941
if (ruleValue === "video") {
1942-
matches = hasVid && !hasAud;
1942+
matches = hasVid;
19431943
} else if (ruleValue === "audio") {
1944-
matches = !hasVid && hasAud;
1944+
matches = hasAud && !hasVid;
19451945
} else if (ruleValue === "av") {
19461946
matches = hasVid && hasAud;
19471947
}
@@ -2070,6 +2070,8 @@ function ocAddNativeCaptionTrack(srtJSON) {
20702070
app.project.importFiles([tempFile.fsName], false, targetBin, false);
20712071
} catch (e) {
20722072
return JSON.stringify({ error: "SRT import failed: " + e.toString() });
2073+
} finally {
2074+
try { tempFile.remove(); } catch (e2) {}
20732075
}
20742076

20752077
return JSON.stringify({ success: true, captions_added: segments.length });

extension/com.opencut.uxp/index.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<path d="M4 2.5a3 3 0 00-1.76 5.43L7.33 11l-5.09 3.07A3 3 0 104.8 19.5a3 3 0 001.76-5.43L8.93 12.6 16.5 17V5L8.93 9.4 6.56 7.93A3 3 0 004 2.5z" fill="var(--accent)"/>
1717
</svg>
1818
<span class="oc-logo">OpenCut</span>
19-
<span class="oc-version">v1.4.0</span>
19+
<span class="oc-version">v1.5.1</span>
2020
</div>
2121
<div class="oc-header-right">
2222
<div class="oc-connection" id="connectionStatus" title="Backend connection status">
@@ -175,7 +175,10 @@
175175
<option value="tiny">tiny (fastest)</option>
176176
<option value="base">base</option>
177177
<option value="small">small</option>
178-
<option value="medium" selected>medium (recommended)</option>
178+
<option value="medium">medium</option>
179+
<option value="turbo" selected>turbo (recommended)</option>
180+
<option value="distil-large-v3.5">distil-large-v3.5 (fast+accurate)</option>
181+
<option value="distil-large-v3">distil-large-v3</option>
179182
<option value="large-v2">large-v2</option>
180183
<option value="large-v3">large-v3 (best)</option>
181184
</select>

extension/com.opencut.uxp/main.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const BACKEND_DEFAULT = "http://127.0.0.1:5679";
2323
const BACKEND_MAX_PORT = 5689;
2424
const POLL_INTERVAL_MS = 1200;
2525
const HEALTH_CHECK_MS = 8000;
26-
const VERSION = "1.5.0";
26+
const VERSION = "1.5.1";
2727

2828
async function detectBackend() {
2929
// Try ports 5679-5689 like CEP panel does
@@ -185,7 +185,7 @@ const BackendClient = (() => {
185185
async function call(method, endpoint, body = null) {
186186
const url = BACKEND + endpoint;
187187
const headers = { "Content-Type": "application/json" };
188-
if (csrfToken) headers["X-CSRF-Token"] = csrfToken;
188+
if (csrfToken) headers["X-OpenCut-Token"] = csrfToken;
189189

190190
const opts = { method, headers };
191191
if (body && method !== "GET") opts.body = JSON.stringify(body);
@@ -232,13 +232,13 @@ const BackendClient = (() => {
232232
* Fetch CSRF token from /csrf or /api/csrf.
233233
*/
234234
async function fetchCsrf() {
235-
const r = await get("/csrf");
236-
if (r.ok && r.data && r.data.token) {
237-
csrfToken = r.data.token;
235+
const r = await get("/health");
236+
if (r.ok && r.data && r.data.csrf_token) {
237+
csrfToken = r.data.csrf_token;
238238
}
239239
}
240240

241-
return { call, get, post, del, checkHealth, fetchCsrf };
241+
return { call, get, post, del: del, checkHealth, fetchCsrf };
242242
})();
243243

244244
// ─────────────────────────────────────────────────────────────
@@ -273,7 +273,7 @@ const JobPoller = (() => {
273273
}
274274

275275
async function pollJob(jobId, onProgress, onComplete, onError) {
276-
const r = await BackendClient.get(`/jobs/${jobId}`);
276+
const r = await BackendClient.get(`/status/${jobId}`);
277277
if (!r.ok) {
278278
onError(r.error ?? "Polling error");
279279
activeJobId = null;
@@ -309,7 +309,7 @@ const JobPoller = (() => {
309309

310310
async function cancel() {
311311
if (!activeJobId) return;
312-
await BackendClient.del(`/jobs/${activeJobId}`);
312+
await BackendClient.post(`/cancel/${activeJobId}`, {});
313313
activeJobId = null;
314314
}
315315

@@ -1372,7 +1372,9 @@ function pad(n) { return String(n).padStart(2, "0"); }
13721372
// ─────────────────────────────────────────────────────────────
13731373
async function checkConnection() {
13741374
UIController.setConnection("connecting");
1375-
const alive = await BackendClient.checkHealth();
1375+
const r = await BackendClient.get("/health");
1376+
const alive = r.ok;
1377+
if (alive && r.data?.csrf_token) csrfToken = r.data.csrf_token;
13761378
UIController.setConnection(alive ? "connected" : "disconnected");
13771379
if (alive) {
13781380
UIController.setStatus("Server online");
@@ -1507,15 +1509,15 @@ function bindSliders() {
15071509
// ─────────────────────────────────────────────────────────────
15081510
async function loadLlmSettings() {
15091511
try {
1510-
const resp = await BackendClient.fetch("GET", "/settings/llm");
1511-
if (resp && !resp.error) {
1512+
const resp = await BackendClient.get("/settings/llm");
1513+
if (resp.ok && resp.data) {
15121514
// Store globally for use in feature functions
1513-
window._llmSettings = resp;
1515+
window._llmSettings = resp.data;
15141516
// If there's a provider select in settings tab, populate it
15151517
const provSel = document.getElementById("llmProvider");
1516-
if (provSel && resp.provider) provSel.value = resp.provider;
1518+
if (provSel && resp.data.provider) provSel.value = resp.data.provider;
15171519
const modInp = document.getElementById("llmModel");
1518-
if (modInp && resp.model) modInp.value = resp.model;
1520+
if (modInp && resp.data.model) modInp.value = resp.data.model;
15191521
}
15201522
} catch (e) {
15211523
console.warn("Could not load LLM settings:", e);

extension/com.opencut.uxp/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "com.opencut.uxp",
33
"name": "OpenCut UXP",
4-
"version": "1.5.0",
4+
"version": "1.5.1",
55
"main": "index.html",
66
"host": [
77
{

0 commit comments

Comments
 (0)