From 470fe4b31ae46065eddcc6985fe0a09102b352ef Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Mon, 13 Nov 2023 08:21:52 -0800 Subject: [PATCH] backfill Subsonic to missing ServerTypes in config --- backend/config.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/config.go b/backend/config.go index 685e75a..87f03aa 100644 --- a/backend/config.go +++ b/backend/config.go @@ -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 }