drop multi-node ssh execution, unify job runner to local + fix job completion atomicity

- remove nodes table, ssh service, nodes api, NodesPage route
- execute.ts: local-only spawn, atomic CAS job claim via UPDATE status
- wrap job done + subtitle_files insert + review_plans status in db transaction
- stream ffmpeg output per line with 500ms throttled flush
- bump version to 2026.04.13
This commit is contained in:
2026-04-13 07:25:19 +02:00
parent 1762f070a9
commit cdcb1ff706
12 changed files with 108 additions and 583 deletions
-2
View File
@@ -54,8 +54,6 @@ export function getDb(): Database {
// Migrations for columns added after initial release
try { _db.exec('ALTER TABLE stream_decisions ADD COLUMN custom_title TEXT'); } catch { /* already exists */ }
try { _db.exec('ALTER TABLE review_plans ADD COLUMN subs_extracted INTEGER NOT NULL DEFAULT 0'); } catch { /* already exists */ }
try { _db.exec("ALTER TABLE nodes ADD COLUMN movies_path TEXT NOT NULL DEFAULT ''"); } catch { /* already exists */ }
try { _db.exec("ALTER TABLE nodes ADD COLUMN series_path TEXT NOT NULL DEFAULT ''"); } catch { /* already exists */ }
try { _db.exec("ALTER TABLE jobs ADD COLUMN job_type TEXT NOT NULL DEFAULT 'audio'"); } catch { /* already exists */ }
// Apple compat pipeline columns
try { _db.exec("ALTER TABLE review_plans ADD COLUMN confidence TEXT NOT NULL DEFAULT 'low'"); } catch { /* already exists */ }
-17
View File
@@ -7,22 +7,6 @@ CREATE TABLE IF NOT EXISTS config (
value TEXT
);
CREATE TABLE IF NOT EXISTS nodes (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL UNIQUE,
host TEXT NOT NULL,
port INTEGER NOT NULL DEFAULT 22,
username TEXT NOT NULL,
private_key TEXT NOT NULL,
ffmpeg_path TEXT NOT NULL DEFAULT 'ffmpeg',
work_dir TEXT NOT NULL DEFAULT '/tmp',
movies_path TEXT NOT NULL DEFAULT '',
series_path TEXT NOT NULL DEFAULT '',
status TEXT NOT NULL DEFAULT 'unknown',
last_checked_at TEXT,
created_at TEXT NOT NULL DEFAULT (datetime('now'))
);
CREATE TABLE IF NOT EXISTS media_items (
id INTEGER PRIMARY KEY AUTOINCREMENT,
jellyfin_id TEXT NOT NULL UNIQUE,
@@ -104,7 +88,6 @@ CREATE TABLE IF NOT EXISTS jobs (
item_id INTEGER NOT NULL REFERENCES media_items(id) ON DELETE CASCADE,
command TEXT NOT NULL,
job_type TEXT NOT NULL DEFAULT 'audio',
node_id INTEGER REFERENCES nodes(id) ON DELETE SET NULL,
status TEXT NOT NULL DEFAULT 'pending',
output TEXT,
exit_code INTEGER,