feat(server): deprecate Scanner.GroupAlbumReleases config option
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -307,6 +307,7 @@ func Load(noConfigDump bool) {
|
|||||||
log.Warn(fmt.Sprintf("Extractor '%s' is not implemented, using 'taglib'", Server.Scanner.Extractor))
|
log.Warn(fmt.Sprintf("Extractor '%s' is not implemented, using 'taglib'", Server.Scanner.Extractor))
|
||||||
Server.Scanner.Extractor = consts.DefaultScannerExtractor
|
Server.Scanner.Extractor = consts.DefaultScannerExtractor
|
||||||
}
|
}
|
||||||
|
logDeprecatedOptions("Scanner.GroupAlbumReleases")
|
||||||
|
|
||||||
// Call init hooks
|
// Call init hooks
|
||||||
for _, hook := range 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
|
// 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]
|
// would require a nested structure, so instead we unmarshal it to a map and then merge the nested [default]
|
||||||
// section into the root level.
|
// section into the root level.
|
||||||
|
|||||||
Reference in New Issue
Block a user