Commit 9ec409f
committed
feat: v1.6.0 Phase 1 — schemas, CSRF rotation, GPU context, FFmpeg cache
New modules:
- opencut/schemas.py — 15 dataclass response schemas (JobResponse,
SilenceResult, LoudnessMatchResult, ColorMatchResult, AutoZoomResult,
MulticamResult, ChaptersResult, RepeatDetectResult, SearchResult,
DeliverableResult, BeatMarkersResult, ExportMarkersResult, IndexResult,
UpdateCheckResult). All have to_dict() with None filtering. Prevents
the field-name mismatch bug class that caused ~40 bugs in batches 30-32.
- opencut/gpu.py — GPUContext context manager for automatic VRAM cleanup.
register() tracks models, __exit__ does del + torch.cuda.empty_cache().
check_vram(min_gb) for preflight. get_device() for cuda/cpu detection.
All torch imports defensive (try/except). Replaces 46 scattered
try/finally/del/empty_cache patterns across 12 core modules.
Security:
- CSRF token rotation with 1-hour TTL. Rotating pool of up to 10 tokens.
New tokens generated when oldest passes half-life. require_csrf accepts
any non-expired token (grace window). Constant-time comparison via
hmac.compare_digest. Replaces static token that was valid forever.
Performance:
- FFmpeg/FFprobe path caching — get_ffmpeg_path() and get_ffprobe_path()
do shutil.which() once and cache. All run_ffmpeg(), FFmpegCmd.build(),
get_video_info() use cached paths. Pre-warmed on server startup after
PATH is configured.1 parent bd25be0 commit 9ec409f
21 files changed
Lines changed: 480 additions & 32 deletions
File tree
- extension
- com.opencut.panel
- CSXS
- client
- com.opencut.uxp
- installer/src/OpenCut.Installer
- Models
- Properties
- opencut
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2943 | 2943 | | |
2944 | 2944 | | |
2945 | 2945 | | |
2946 | | - | |
| 2946 | + | |
2947 | 2947 | | |
2948 | 2948 | | |
2949 | 2949 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
0 commit comments