Skip to content

Commit 6ea81d1

Browse files
committed
refactor: v1.9.3 — split video.py into 5 blueprints, async_job adoption, app factory
Split monolithic video.py (3636 lines) into 5 domain blueprints: video_core (1395), video_editing (750), video_fx (687), video_specialty (489), video_ai (443). All URL paths unchanged. Converted all 97 manual _new_job/Thread/_update_job patterns across 6 route files to @async_job decorator, removing ~2800 lines of boilerplate and fixing cancelled-job-overwritten-to-complete race condition. Added app factory pattern (create_app + OpenCutConfig dataclass), install route factory (make_install_route replaces 6 identical handlers), version sync CI enforcement with --check flag.
1 parent db9576a commit 6ea81d1

52 files changed

Lines changed: 6341 additions & 8544 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ jobs:
5050
pip install pytest-cov
5151
python -m pytest tests/ -v --tb=short --cov=opencut --cov-report=term-missing --cov-fail-under=50
5252
53+
- name: Check version sync
54+
run: python scripts/sync_version.py --check
55+
5356
- name: Smoke test imports
5457
run: |
5558
python -c "from opencut.server import app; print('Import OK')"

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## [1.9.2] - 2026-03-26
3+
## [1.9.3] - 2026-03-27
44

55
### Added
66
- **JSON Structured Logging** (Phase 0.3) — File handler now outputs JSON via `python-json-logger`. Each log line includes `timestamp`, `level`, `module`, `job_id`, `message`. Console handler stays plain text. Graceful fallback if `python-json-logger` not installed.
@@ -15,6 +15,13 @@
1515
- **Core Module Unit Tests Batch 2** (Phase 0.1) — 135 additional tests across 28 previously untested core modules (animated_captions, audio_enhance, audio_pro, audio_suite, caption_burnin, captions_enhanced, color_management, emotion_highlights, face_swap, face_tools, lut_library, motion_graphics, music_ai, music_gen, object_removal, particles, shorts_pipeline, style_transfer, styled_captions, transitions_3d, upscale_pro, video_ai, voice_gen, zoom, broll_insert, broll_generate, multimodal_diarize, social_post).
1616
- **ExtendScript Mock Harness** (Phase 0.1) — `tests/jsx_mock.js` provides fake Premiere Pro DOM (app.project, activeSequence, tracks, markers, ProjectItem). Tests 38 ExtendScript functions including ocApplySequenceCuts, ocBatchRenameProjectItems, ocAddSequenceMarkers, ocAddNativeCaptionTrack. 35 assertions pass under Node.js.
1717

18+
### Refactored
19+
- **`async_job` decorator adoption** — All 97 manual `_new_job()` + `threading.Thread` + `_update_job(status="complete")` patterns across 6 route files converted to `@async_job` decorator. Fixes race condition where cancelled jobs could be overwritten to "complete". Removes ~2,800 lines of boilerplate. Decorator extended with `filepath_required` and `filepath_param` parameters.
20+
- **Split `video.py` into 5 domain blueprints** — Monolithic 3636-line `video.py` split into `video_core.py` (1395), `video_editing.py` (750), `video_fx.py` (687), `video_specialty.py` (489), `video_ai.py` (443). No file exceeds 1400 lines. All URL paths unchanged.
21+
- **App factory pattern**`server.py` now exposes `create_app(config)` for isolated Flask instances. New `opencut/config.py` centralizes env var reads into `OpenCutConfig` dataclass. Tests use independent app instances. Module-level `app = create_app()` preserved for backward compat.
22+
- **Install route factory**`make_install_route()` in `opencut/jobs.py` replaces 6 identical install endpoint handlers (depth, emotion, multimodal-diarize, broll-generate, face, crisper-whisper) with a single factory call per route.
23+
- **Version sync CI enforcement**`scripts/sync_version.py` now includes `package.json` in targets and supports `--check` flag for CI. Added to `.github/workflows/build.yml`.
24+
1825
### Security
1926
- Replaced all `__import__()` calls with `importlib.import_module()` / `importlib.util.find_spec()` in helpers.py, system.py, engine_registry.py, plugins.py
2027

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.9.0" -ForegroundColor DarkGray
158+
Write-Host " Installer v1.9.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.9.0"
5+
#define MyAppVersion "1.9.3"
66
#define MyAppPublisher "SysAdminDoc"
77
#define MyAppURL "https://github.com/SysAdminDoc/OpenCut"
88

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"parserOptions": {
7+
"ecmaVersion": 2021,
8+
"sourceType": "script"
9+
},
10+
"rules": {
11+
"no-undef": "warn",
12+
"no-unused-vars": "warn",
13+
"no-redeclare": "warn",
14+
"eqeqeq": ["warn", "smart"],
15+
"no-eval": "error"
16+
},
17+
"globals": {
18+
"CSInterface": "readonly",
19+
"CSEvent": "readonly",
20+
"SystemPath": "readonly"
21+
}
22+
}
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
{
22
"name": "opencut-panel",
3-
"version": "1.7.2",
3+
"version": "1.9.3",
44
"private": true,
55
"description": "OpenCut CEP Panel for Adobe Premiere Pro",
66
"scripts": {
77
"dev": "vite build --watch",
88
"build": "vite build",
9-
"preview": "vite preview"
9+
"preview": "vite preview",
10+
"lint": "eslint client/main.js"
1011
},
1112
"devDependencies": {
13+
"eslint": "^8.0.0",
1214
"vite": "^5.0.0"
1315
}
1416
}

install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import subprocess
1111
import platform
1212

13-
VERS = "1.9.0"
13+
VERS = "1.9.3"
1414
CEP_EXT = "com.opencut.panel"
1515
WIN_CEP_DIR = os.path.expandvars(r"%APPDATA%\Adobe\CEP\extensions")
1616
MAC_CEP_DIR = os.path.expanduser("~/Library/Application Support/Adobe/CEP/extensions")

installer/src/OpenCut.Installer/OpenCut.Installer.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<RootNamespace>OpenCut.Installer</RootNamespace>
88
<AssemblyName>OpenCut-Setup</AssemblyName>
99
<ApplicationIcon>Assets\logo.ico</ApplicationIcon>
10-
<Version>1.9.0</Version>
11-
<FileVersion>1.9.0.0</FileVersion>
10+
<Version>1.9.3</Version>
11+
<FileVersion>1.9.3.0</FileVersion>
1212
<AssemblyVersion>1.3.0.0</AssemblyVersion>
1313
<Company>SysAdminDoc</Company>
1414
<Product>OpenCut Installer</Product>

installer/src/OpenCut.Installer/Properties/app.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
3-
<assemblyIdentity version="1.9.0.0" name="OpenCut.Installer" />
3+
<assemblyIdentity version="1.9.3.0" name="OpenCut.Installer" />
44
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
55
<security>
66
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">

installer/src/OpenCut.Installer/bin/Release/net9.0-windows/win-x64/OpenCut-Setup.deps.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"targets": {
88
".NETCoreApp,Version=v9.0": {},
99
".NETCoreApp,Version=v9.0/win-x64": {
10-
"OpenCut-Setup/1.9.0": {
10+
"OpenCut-Setup/1.9.3": {
1111
"dependencies": {
1212
"runtimepack.Microsoft.NETCore.App.Runtime.win-x64": "9.0.14",
1313
"runtimepack.Microsoft.WindowsDesktop.App.Runtime.win-x64": "9.0.14"
@@ -943,7 +943,7 @@
943943
}
944944
},
945945
"libraries": {
946-
"OpenCut-Setup/1.9.0": {
946+
"OpenCut-Setup/1.9.3": {
947947
"type": "project",
948948
"serviceable": false,
949949
"sha512": ""

0 commit comments

Comments
 (0)