diff --git a/conf/configuration.go b/conf/configuration.go index 2636fbf94..b4e38add2 100644 --- a/conf/configuration.go +++ b/conf/configuration.go @@ -128,7 +128,8 @@ type scannerOptions struct { WatcherWait time.Duration ScanOnStartup bool Extractor string - GroupAlbumReleases bool // Deprecated: BFR Update docs + GenreSeparators string // Deprecated: Use Tags.genre.Split instead + GroupAlbumReleases bool // Deprecated: Use PID.Album instead } type subsonicOptions struct { @@ -307,6 +308,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.GenreSeparators") logDeprecatedOptions("Scanner.GroupAlbumReleases") // Call init hooks @@ -489,9 +491,10 @@ func init() { viper.SetDefault("scanner.enabled", true) viper.SetDefault("scanner.schedule", "0") viper.SetDefault("scanner.extractor", consts.DefaultScannerExtractor) - viper.SetDefault("scanner.groupalbumreleases", false) viper.SetDefault("scanner.watcherwait", consts.DefaultWatcherWait) viper.SetDefault("scanner.scanonstartup", true) + viper.SetDefault("scanner.genreseparators", "") + viper.SetDefault("scanner.groupalbumreleases", false) viper.SetDefault("subsonic.appendsubtitle", true) viper.SetDefault("subsonic.artistparticipations", false) diff --git a/model/tag_mappings.go b/model/tag_mappings.go index b0cf85fae..14edd3b0e 100644 --- a/model/tag_mappings.go +++ b/model/tag_mappings.go @@ -175,6 +175,15 @@ func loadTagMappings() { log.Error("No tag mappings found in mappings.yaml, check the format") } + // Use Scanner.GenreSeparators if specified and Tags.genre is not defined + if conf.Server.Scanner.GenreSeparators != "" && len(conf.Server.Tags["genre"].Aliases) == 0 { + genreConf := _mappings.Main[TagName("genre")] + genreConf.Split = strings.Split(conf.Server.Scanner.GenreSeparators, "") + genreConf.SplitRx = compileSplitRegex("genre", genreConf.Split) + _mappings.Main[TagName("genre")] = genreConf + log.Debug("Loading deprecated list of genre separators", "separators", genreConf.Split) + } + // Overwrite the default mappings with the ones from the config for tag, cfg := range conf.Server.Tags { if len(cfg.Aliases) == 0 {