mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-01 19:47:37 +03:00
feat(server): deprecate Scanner.GroupAlbumReleases
config option
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
31e003e6f3
commit
21a5528f5e
1 changed files with 13 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue