Skip to content

🎧 Your Personal Streaming Service

feat(server): deprecate `Scanner.GroupAlbumReleases` config option

Deluan21a5528f5ed7
diff --git a/conf/configuration.go b/conf/configuration.go
index cf49606c9..c5b4c6179 100644
--- a/conf/configuration.go
+++ b/conf/configuration.go
@@ -307,6 +307,7 @@ func Load(noConfigDump bool) {
log.Warn(fmt.Sprintf("Extractor '%s' is not implemented, using 'taglib'", Server.Scanner.Extractor))
Server.Scanner.Extractor = consts.DefaultScannerExtractor
}
+ logDeprecatedOptions("Scanner.GroupAlbumReleases")
// Call init hooks
for _, hook := range hooks {
@@ -314,6 +315,18 @@ func Load(noConfigDump bool) {
}
}
+func logDeprecatedOptions(options ...string) {
+ for _, option := range options {
+ envVar := "ND_" + strings.ToUpper(strings.ReplaceAll(option, ".", "_"))
+ if os.Getenv(envVar) != "" {
+ log.Warn(fmt.Sprintf("Option '%s' is deprecated and will be ignored in a future release", envVar))
+ }
+ if viper.InConfig(option) {
+ log.Warn(fmt.Sprintf("Option '%s' is deprecated and will be ignored in a future release", option))
+ }
+ }
+}
+
// parseIniFileConfiguration is used to parse the config file when it is in INI format. For INI files, it
// would require a nested structure, so instead we unmarshal it to a map and then merge the nested [default]
// section into the root level.