mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-18 08:36:13 +00:00
Startup treated an empty server_url as "first run" and wrote a fresh default settings.json via createDefaultSettings, which builds the struct from CLI flags and does not merge the existing file. A hand-authored settings.json that sets, say, trust_forwarded_headers but leaves server_url to the --server-url flag has no server_url, so it was silently clobbered on first start (losing the operator's keys). Gate the default-seed (and the lost-volume "first run" notice) on the ABSENCE of settings.json instead. An existing file is now always respected; a genuinely empty data dir still gets defaults and the notice. This also fixes a latent loop where a never-set server_url made every start look like a first run. Adds regression tests: settingsFileExists, plus first-run seed both preserving a hand-authored file and writing defaults when absent. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>