diff --git a/servers/legion/k8s/media/overseerr.yaml b/servers/legion/k8s/media/overseerr.yaml index f583b71..29f6a3b 100644 --- a/servers/legion/k8s/media/overseerr.yaml +++ b/servers/legion/k8s/media/overseerr.yaml @@ -29,14 +29,26 @@ data: if (fs.existsSync(SETTINGS)) { try { settings = JSON.parse(fs.readFileSync(SETTINGS, 'utf8')); } catch(e) {} } + // Seerr's Settings.load runs in raw mode during the overseerrMerge check, + // which replaces this.data entirely with the file contents. If settings.main + // is absent, it crashes at "this.data.main.apiKey" (settings/index.js:418). + // Ensure main exists with mediaServerType=JELLYFIN so the merge check is skipped. + if (!settings.main) { + settings.main = {}; + } + if (!settings.main.mediaServerType) { + settings.main.mediaServerType = 'JELLYFIN'; + console.log('Set main.mediaServerType = JELLYFIN'); + } if (!settings.jellyfin || !settings.jellyfin.apiKey) { console.log('Jellyfin apiKey missing — restoring from defaults'); settings.jellyfin = JSON.parse(fs.readFileSync(DEFAULTS, 'utf8')); - fs.writeFileSync(SETTINGS, JSON.stringify(settings, null, 2)); console.log('Restored Jellyfin config'); } else { console.log('Jellyfin config present, skipping restore'); } + fs.writeFileSync(SETTINGS, JSON.stringify(settings, null, 2)); + console.log('Settings written successfully'); --- apiVersion: apps/v1 kind: Deployment