backfill Subsonic to missing ServerTypes in config

This commit is contained in:
Drew Weymouth
2023-11-14 09:05:02 -08:00
parent cafca00b1b
commit 470fe4b31a
+9
View File
@@ -212,6 +212,15 @@ func ReadConfigFile(filepath, appVersionTag string) (*Config, error) {
if err := toml.NewDecoder(f).Decode(c); err != nil {
return nil, err
}
// Backfill Subsonic to empty ServerType fields
// for updating configs created before multiple MediaProviders were added
for _, s := range c.Servers {
if s.ServerType == "" {
s.ServerType = ServerTypeSubsonic
}
}
return c, nil
}