Files
SubMiner/launcher/config/jellyfin-config.ts
sudacode 420b985c7a refactor(launcher): split config parser and CLI builder
Decompose launcher/config.ts into focused domain parser and CLI normalization modules to reduce refactor risk while preserving command behavior. Align Jellyfin launcher config with session-based auth by dropping config token/userId dependency.
2026-02-22 12:01:04 -08:00

17 lines
907 B
TypeScript

import type { LauncherJellyfinConfig } from '../types.js';
export function parseLauncherJellyfinConfig(root: Record<string, unknown>): LauncherJellyfinConfig {
const jellyfinRaw = root.jellyfin;
if (!jellyfinRaw || typeof jellyfinRaw !== 'object') return {};
const jellyfin = jellyfinRaw as Record<string, unknown>;
return {
enabled: typeof jellyfin.enabled === 'boolean' ? jellyfin.enabled : undefined,
serverUrl: typeof jellyfin.serverUrl === 'string' ? jellyfin.serverUrl : undefined,
username: typeof jellyfin.username === 'string' ? jellyfin.username : undefined,
defaultLibraryId:
typeof jellyfin.defaultLibraryId === 'string' ? jellyfin.defaultLibraryId : undefined,
pullPictures: typeof jellyfin.pullPictures === 'boolean' ? jellyfin.pullPictures : undefined,
iconCacheDir: typeof jellyfin.iconCacheDir === 'string' ? jellyfin.iconCacheDir : undefined,
};
}