Context
#7 changed the config schema:
Before
After
AppConfig.parse now throws on an old-shape file (servers is an array, not an object; no indexer block), so anyone upgrading with their existing config gets a hard Zod error at boot with no guidance.
Ask
Detect the legacy shape and migrate it (or, at minimum, fail with a clear, actionable message + a documented mapping). Proposed mapping:
servers.destinations[] (radarr/sonarr) → servers[] with destination: true.
servers.sources[] of type jellyfin → dropped, with a warning that Jellyfin sourcing was removed (point at Radarr/Sonarr source: true).
servers.peers[] → top-level peers[].
indexer.autoRegister / indexer.priority → per-server autoregister: { enable, priority }.
Implementation ideas: a pre-parse migration step in getAppConfig that recognizes the old shape (e.g. servers is a non-array object) and rewrites it in-memory (optionally writing the migrated file back with a .bak of the original), logging what changed.
Context
#7 changed the config schema:
Before
{ "indexer": { "priority": 1, "autoRegister": true }, "servers": { "sources": [{ "type": "jellyfin", ... }], "peers": [{ ... }], "destinations": [{ "type": "radarr", ... }, { "type": "sonarr", ... }] } }After
{ "servers": [ { "type": "radarr", ..., "source": true, "destination": true, "autoregister": { "enable": true, "priority": 1 } } ], "peers": [{ ... }] }AppConfig.parsenow throws on an old-shape file (serversis an array, not an object; noindexerblock), so anyone upgrading with their existing config gets a hard Zod error at boot with no guidance.Ask
Detect the legacy shape and migrate it (or, at minimum, fail with a clear, actionable message + a documented mapping). Proposed mapping:
servers.destinations[](radarr/sonarr) →servers[]withdestination: true.servers.sources[]of typejellyfin→ dropped, with a warning that Jellyfin sourcing was removed (point at Radarr/Sonarrsource: true).servers.peers[]→ top-levelpeers[].indexer.autoRegister/indexer.priority→ per-serverautoregister: { enable, priority }.Implementation ideas: a pre-parse migration step in
getAppConfigthat recognizes the old shape (e.g.serversis a non-array object) and rewrites it in-memory (optionally writing the migrated file back with a.bakof the original), logging what changed.