Skip to content

Commit 90cf2c2

Browse files
committed
v1.10.3: Journal 'Apply to selection' (feature N)
Every journal entry that carries a stored forward payload now shows an 'Apply to selection' button when the user has a clip selected that differs from the entry's original clip. Clicking re-runs the same action on the new clip with the original params. Schema migration: - Added forward_json TEXT column to the journal table via additive ALTER TABLE wrapped in try/except (SQLite tolerates re-running). Pre-existing rows stay NULL; the UI hides the button when forward is absent, so legacy entries render exactly as before. Backend: - journal.record() grows a forward_payload kwarg; the route accepts 'forward' (optional, must be dict). - _row_to_dict returns entry['forward'] for the UI. Frontend: - journalRecord() takes a 5th 'forwardPayload' param. - Three call-sites now pass forward payloads: * addBeatMarkersToSequence: {endpoint: '__jsx_add_markers__', payload: {markers: [...]}} — ExtendScript-dispatch pseudo-route * importXML/onJobDone: {endpoint: job.endpoint, payload: job.payload} * batchRename: intentionally null (node ids are project-scoped) - _buildJournalRow renders the 'Apply to selection' button when entry.forward.endpoint exists and selectedPath differs from entry.clip_path. _journalApplyToSelection() dispatches — directly to ExtendScript for __jsx_add_markers__, or via startJob() for HTTP endpoints with the filepath swapped.
1 parent a53df6e commit 90cf2c2

19 files changed

Lines changed: 132 additions & 30 deletions

File tree

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.10.2" -ForegroundColor DarkGray
158+
Write-Host " Installer v1.10.3" -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.10.2"
5+
#define MyAppVersion "1.10.3"
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.10.2"
5+
ExtensionBundleVersion="1.10.3"
66
ExtensionBundleName="OpenCut">
77

88
<ExtensionList>
9-
<Extension Id="com.opencut.panel.main" Version="1.10.2" />
9+
<Extension Id="com.opencut.panel.main" Version="1.10.3" />
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
@@ -3633,7 +3633,7 @@ <h3 class="media-sidecar-title">No media in the workspace yet.</h3>
36333633
<div class="card-header"><div class="card-title" data-i18n="settings.about">About OpenCut</div></div>
36343634
<div class="settings-row">
36353635
<span class="settings-label">Version</span>
3636-
<span class="settings-value">1.10.2</span>
3636+
<span class="settings-value">1.10.3</span>
36373637
</div>
36383638
<div class="about-links">
36393639
<a href="https://github.com/SysAdminDoc/opencut" class="about-link" target="_blank">GitHub</a>

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

Lines changed: 79 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ============================================================
2-
OpenCut CEP Panel - Main Controller v1.10.2
2+
OpenCut CEP Panel - Main Controller v1.10.3
33
6-Tab Professional Toolkit
44
============================================================ */
55
(function () {
@@ -1408,14 +1408,18 @@
14081408
// Every ExtendScript operation that mutates the Premiere project calls
14091409
// journalRecord() after success. The Journal sub-tab under Settings
14101410
// renders the history and dispatches inverse calls via PremiereBridge.
1411-
function journalRecord(action, label, inversePayload, clipPath) {
1411+
function journalRecord(action, label, inversePayload, clipPath, forwardPayload) {
14121412
if (!connected) return;
1413-
api("POST", "/journal/record", {
1413+
var body = {
14141414
action: action,
14151415
label: label || "",
14161416
clip_path: clipPath || "",
14171417
inverse: inversePayload || {}
1418-
}, function (err, entry) {
1418+
};
1419+
// v1.10.3 (N): include forward {endpoint, payload} so journal
1420+
// rows can later expose "Apply to selection".
1421+
if (forwardPayload) body.forward = forwardPayload;
1422+
api("POST", "/journal/record", body, function (err, entry) {
14191423
if (err) {
14201424
// Never surface journal-record failures to the user — the
14211425
// forward operation already succeeded.
@@ -3225,7 +3229,12 @@
32253229
"import_sequence",
32263230
_sessionCtxOpText(job) + " → '" + r.sequence_name + "'",
32273231
{ name: r.sequence_name },
3228-
selectedPath
3232+
selectedPath,
3233+
// Forward replay = re-run the same job type
3234+
// (silence / full / etc) on a different clip.
3235+
job.endpoint && job.payload
3236+
? { endpoint: job.endpoint, payload: job.payload }
3237+
: null
32293238
);
32303239
}
32313240
} catch (e) { console.error("XML import parse error:", e); }
@@ -6252,10 +6261,64 @@
62526261
actions.appendChild(revertBtn);
62536262
}
62546263

6264+
// v1.10.3 (N): "Apply to selection" when the journal entry has a
6265+
// forward payload and the user currently has a different clip
6266+
// selected than the one the entry ran on.
6267+
var fwd = entry.forward;
6268+
var canReplay = fwd && fwd.endpoint &&
6269+
selectedPath && entry.clip_path && selectedPath !== entry.clip_path;
6270+
if (canReplay) {
6271+
var applyBtn = document.createElement("button");
6272+
applyBtn.type = "button";
6273+
applyBtn.className = "btn btn-ghost btn-sm";
6274+
applyBtn.textContent = "Apply to selection";
6275+
applyBtn.title = "Run the same action on '" +
6276+
(selectedName || "selection") + "' with the same params";
6277+
applyBtn.addEventListener("click", function () {
6278+
_journalApplyToSelection(entry);
6279+
});
6280+
actions.appendChild(applyBtn);
6281+
}
6282+
62556283
row.appendChild(actions);
62566284
return row;
62576285
}
62586286

6287+
function _journalApplyToSelection(entry) {
6288+
var fwd = entry && entry.forward;
6289+
if (!fwd) return;
6290+
if (!selectedPath) { showAlert("Select a clip first."); return; }
6291+
// ExtendScript-dispatch actions get a special pseudo-endpoint.
6292+
if (fwd.endpoint === "__jsx_add_markers__") {
6293+
if (!inPremiere) {
6294+
showAlert("Premiere connection required.");
6295+
return;
6296+
}
6297+
var markers = (fwd.payload && fwd.payload.markers) || [];
6298+
if (!markers.length) { showAlert("No markers to replay."); return; }
6299+
var payload = JSON.stringify(markers);
6300+
cs.evalScript(
6301+
"ocAddSequenceMarkers('" +
6302+
payload.replace(/\\/g, "\\\\").replace(/'/g, "\\'") + "')",
6303+
function (result) {
6304+
try {
6305+
var r = JSON.parse(result || "{}");
6306+
if (r.error) { showAlert("Apply failed: " + r.error); return; }
6307+
showToast("Re-added " + markers.length + " markers on '" +
6308+
(selectedName || "selection") + "'", "success");
6309+
} catch (e) { showAlert("Apply failed: " + (result || e.message)); }
6310+
}
6311+
);
6312+
return;
6313+
}
6314+
// HTTP endpoints: replace filepath with the current selection
6315+
var replay = JSON.parse(JSON.stringify(fwd.payload || {}));
6316+
replay.filepath = selectedPath;
6317+
showToast("Applying " + _journalActionLabel(entry.action) +
6318+
" to '" + (selectedName || "selection") + "'…", "info");
6319+
startJob(fwd.endpoint, replay);
6320+
}
6321+
62596322
function _journalRevert(entry, btn) {
62606323
if (!inPremiere) { showAlert("Premiere Pro connection required to revert."); return; }
62616324
if (!entry.revertible) { return; }
@@ -10486,7 +10549,11 @@
1048610549
"add_markers",
1048710550
_journalLabelForMarkers(markers.length, selectedName),
1048810551
{ markers: fingerprints },
10489-
selectedPath
10552+
selectedPath,
10553+
// Forward op: re-add the same beat markers on a
10554+
// different clip. endpoint dispatches to ExtendScript.
10555+
{ endpoint: "__jsx_add_markers__",
10556+
payload: { markers: markers } }
1049010557
);
1049110558
}
1049210559
} catch (e) { showAlert("Error adding markers: " + (result || e.message)); }
@@ -10707,7 +10774,12 @@
1070710774
journalRecord(
1070810775
"batch_rename",
1070910776
_journalLabelForRename(reverseList.length),
10710-
{ renames: reverseList }
10777+
{ renames: reverseList },
10778+
"",
10779+
// Forward replay isn't meaningful for rename —
10780+
// the nodeIds are project-scoped and the "new"
10781+
// names were project-specific.
10782+
null
1071110783
);
1071210784
}
1071310785
} catch (e) { showAlert("Error: " + (result || e.message)); }

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.10.2 - ULTRA PREMIUM EDITION
2+
OpenCut CEP Panel v1.10.3 - ULTRA PREMIUM EDITION
33
Next-Generation AI Editing Suite for Adobe Premiere Pro
44
============================================================ */
55

extension/com.opencut.panel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencut-panel",
3-
"version": "1.10.2",
3+
"version": "1.10.3",
44
"private": true,
55
"description": "OpenCut CEP Panel for Adobe Premiere Pro",
66
"scripts": {

extension/com.opencut.uxp/index.html

Lines changed: 1 addition & 1 deletion
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.10.2</span>
19+
<span class="oc-version">v1.10.3</span>
2020
</div>
2121
<div class="oc-header-right">
2222
<div class="oc-connection" id="connectionStatus" title="Backend connection status">

extension/com.opencut.uxp/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const HEALTH_CHECK_MS = 8000;
2626
const HEALTH_MAX_MS = 60000;
2727
const MEDIA_SCAN_MS = 30000;
2828
const SSE_AVAILABLE = typeof EventSource !== "undefined";
29-
const VERSION = "1.10.2";
29+
const VERSION = "1.10.3";
3030

3131
async function detectBackend() {
3232
// Try ports 5679-5689 like CEP panel does

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.10.2",
4+
"version": "1.10.3",
55
"main": "index.html",
66
"host": [
77
{

0 commit comments

Comments
 (0)