backfill Subsonic to missing ServerTypes in config
This commit is contained in:
@@ -212,6 +212,15 @@ func ReadConfigFile(filepath, appVersionTag string) (*Config, error) {
|
|||||||
if err := toml.NewDecoder(f).Decode(c); err != nil {
|
if err := toml.NewDecoder(f).Decode(c); err != nil {
|
||||||
return nil, err
|
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
|
return c, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user