diff --git a/server/db/index.ts b/server/db/index.ts index 115d6f2..b2abb0b 100644 --- a/server/db/index.ts +++ b/server/db/index.ts @@ -57,7 +57,13 @@ export function getDb(): Database { 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 */ } + try { _db.exec('ALTER TABLE review_plans ADD COLUMN apple_compat TEXT'); } catch { /* already exists */ } + try { _db.exec("ALTER TABLE review_plans ADD COLUMN job_type TEXT NOT NULL DEFAULT 'copy'"); } catch { /* already exists */ } + try { _db.exec('ALTER TABLE stream_decisions ADD COLUMN transcode_codec TEXT'); } catch { /* already exists */ } seedDefaults(_db); + return _db; } diff --git a/server/db/schema.ts b/server/db/schema.ts index 24c226a..73fdf80 100644 --- a/server/db/schema.ts +++ b/server/db/schema.ts @@ -129,4 +129,8 @@ export const DEFAULT_CONFIG: Record = { audio_languages: '[]', scan_running: '0', + job_sleep_seconds: '0', + schedule_enabled: '0', + schedule_start: '01:00', + schedule_end: '07:00', }; diff --git a/server/services/apple-compat.ts b/server/services/apple-compat.ts index 55655f8..97c620f 100644 --- a/server/services/apple-compat.ts +++ b/server/services/apple-compat.ts @@ -9,12 +9,6 @@ const APPLE_COMPATIBLE_AUDIO = new Set([ 'opus', ]); -// Lossless source codecs — get FLAC in MKV, EAC3 in MP4 -const LOSSLESS_CODECS = new Set([ - 'dts', // DTS-HD MA reports as 'dts' with profile - 'truehd', -]); - // Codec strings Jellyfin may report for DTS variants const DTS_CODECS = new Set([ 'dts', 'dca', diff --git a/server/types.ts b/server/types.ts index d17176e..118f16a 100644 --- a/server/types.ts +++ b/server/types.ts @@ -48,6 +48,9 @@ export interface ReviewPlan { item_id: number; status: 'pending' | 'approved' | 'skipped' | 'done' | 'error'; is_noop: number; + confidence: 'high' | 'low'; + apple_compat: 'direct_play' | 'remux' | 'audio_transcode' | null; + job_type: 'copy' | 'transcode'; subs_extracted: number; notes: string | null; reviewed_at: string | null; @@ -73,13 +76,14 @@ export interface StreamDecision { action: 'keep' | 'remove'; target_index: number | null; custom_title: string | null; + transcode_codec: string | null; } export interface Job { id: number; item_id: number; command: string; - job_type: 'audio' | 'subtitle'; + job_type: 'copy' | 'transcode'; node_id: number | null; status: 'pending' | 'running' | 'done' | 'error'; output: string | null; @@ -115,8 +119,11 @@ export interface StreamWithDecision extends MediaStream { export interface PlanResult { is_noop: boolean; has_subs: boolean; - decisions: Array<{ stream_id: number; action: 'keep' | 'remove'; target_index: number | null }>; - notes: string | null; + confidence: 'high' | 'low'; + apple_compat: 'direct_play' | 'remux' | 'audio_transcode' | null; + job_type: 'copy' | 'transcode'; + decisions: Array<{ stream_id: number; action: 'keep' | 'remove'; target_index: number | null; transcode_codec: string | null }>; + notes: string[]; } // ─── Jellyfin API types ─────────────────────────────────────────────────────── diff --git a/src/shared/lib/types.ts b/src/shared/lib/types.ts index 2f536f4..c99a28d 100644 --- a/src/shared/lib/types.ts +++ b/src/shared/lib/types.ts @@ -46,6 +46,9 @@ export interface ReviewPlan { item_id: number; status: string; is_noop: number; + confidence: 'high' | 'low'; + apple_compat: 'direct_play' | 'remux' | 'audio_transcode' | null; + job_type: 'copy' | 'transcode'; subs_extracted: number; notes: string | null; reviewed_at: string | null; @@ -71,6 +74,7 @@ export interface StreamDecision { action: 'keep' | 'remove'; target_index: number | null; custom_title: string | null; + transcode_codec: string | null; } export interface Job { @@ -78,7 +82,7 @@ export interface Job { item_id: number; node_id: number | null; command: string; - job_type: 'audio' | 'subtitle'; + job_type: 'copy' | 'transcode'; status: 'pending' | 'running' | 'done' | 'error'; output: string | null; exit_code: number | null;