From e38a1c945eb944c92c185c2f472b9160a60ca684 Mon Sep 17 00:00:00 2001 From: sudacode Date: Tue, 17 Feb 2026 19:00:18 -0800 Subject: [PATCH] feat(jellyfin): add remote playback and config plumbing --- config.example.jsonc | 48 +- docs/index.md | 16 - launcher/config.ts | 655 ++++---- launcher/jellyfin.ts | 87 +- launcher/main.ts | 126 ++ launcher/mpv.ts | 103 +- launcher/picker.ts | 8 +- launcher/types.ts | 10 +- package.json | 7 +- pnpm-lock.yaml | 9 + src/cli/args.test.ts | 40 + src/cli/args.ts | 114 +- src/cli/help.test.ts | 4 + src/cli/help.ts | 115 +- src/config/config.test.ts | 240 ++- src/config/definitions.ts | 211 ++- src/config/service.ts | 325 +++- src/config/template.ts | 28 +- src/core/services/cli-command.test.ts | 147 +- src/core/services/cli-command.ts | 37 +- src/core/services/index.ts | 24 +- src/core/services/jellyfin-remote.test.ts | 334 ++++ src/core/services/jellyfin-remote.ts | 448 ++++++ src/core/services/jellyfin.test.ts | 702 +++++++++ src/core/services/jellyfin.ts | 571 +++++++ src/core/services/mpv-protocol.test.ts | 45 +- src/core/services/mpv-protocol.ts | 44 +- src/core/services/mpv-state.test.ts | 5 +- src/core/services/mpv-transport.test.ts | 16 +- src/core/services/mpv-transport.ts | 4 +- src/core/services/mpv.test.ts | 24 +- src/core/services/mpv.ts | 36 +- src/core/services/startup-bootstrap.test.ts | 48 +- src/main.ts | 1558 +++++++++++++++---- src/main/cli-runtime.ts | 31 +- src/main/dependencies.ts | 37 +- src/main/state.ts | 5 + src/preload.ts | 4 +- src/renderer/modals/runtime-options.ts | 35 +- src/renderer/modals/session-help.ts | 197 ++- src/runtime-options.ts | 39 +- src/types.ts | 84 +- 42 files changed, 5608 insertions(+), 1013 deletions(-) create mode 100644 src/core/services/jellyfin-remote.test.ts create mode 100644 src/core/services/jellyfin-remote.ts create mode 100644 src/core/services/jellyfin.test.ts create mode 100644 src/core/services/jellyfin.ts diff --git a/config.example.jsonc b/config.example.jsonc index e3ecabc..9bd6fe1 100644 --- a/config.example.jsonc +++ b/config.example.jsonc @@ -262,6 +262,40 @@ "accessToken": "" }, + // ========================================== + // Jellyfin + // Optional Jellyfin integration for auth, browsing, and playback launch. + // Access token is stored in config and should be treated as a secret. + // ========================================== + "jellyfin": { + "enabled": false, + "serverUrl": "", + "username": "", + "accessToken": "", + "userId": "", + "deviceId": "subminer", + "clientName": "SubMiner", + "clientVersion": "0.1.0", + "defaultLibraryId": "", + "remoteControlEnabled": true, + "remoteControlAutoConnect": true, + "autoAnnounce": false, + "remoteControlDeviceName": "SubMiner", + "pullPictures": false, + "iconCacheDir": "/tmp/subminer-jellyfin-icons", + "directPlayPreferred": true, + "directPlayContainers": [ + "mkv", + "mp4", + "webm", + "mov", + "flac", + "mp3", + "aac" + ], + "transcodeVideoCodec": "h264" + }, + // ========================================== // Immersion Tracking // Enable/disable immersion tracking. @@ -269,6 +303,18 @@ // ========================================== "immersionTracking": { "enabled": true, - "dbPath": "" + "dbPath": "", + "batchSize": 25, + "flushIntervalMs": 500, + "queueCap": 1000, + "payloadCapBytes": 256, + "maintenanceIntervalMs": 86400000, + "retention": { + "eventsDays": 7, + "telemetryDays": 30, + "dailyRollupsDays": 365, + "monthlyRollupsDays": 1825, + "vacuumIntervalDays": 7 + } } } diff --git a/docs/index.md b/docs/index.md index 153a6cb..8efeeba 100644 --- a/docs/index.md +++ b/docs/index.md @@ -176,22 +176,6 @@ features:
-## CLI Quick Reference - -```bash -subminer # Default picker + playback workflow -subminer jellyfin -d # Jellyfin cast discovery mode (foreground) -subminer jellyfin -p # Jellyfin play picker -subminer yt -o ~/subs URL # YouTube subcommand with output dir shortcut -subminer doctor # Dependency/config/socket health checks -subminer config path # Active config file path -subminer config show # Print active config -subminer mpv status # MPV socket readiness -subminer texthooker # Texthooker-only mode -``` - -See [Usage](/usage) for full command and option coverage. - ## See It in Action