fix(scanner): allow disabling splitting with the Tags config option (#3869)

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan Quintão 2025-03-22 12:34:35 -04:00 committed by GitHub
parent 63dc0e2062
commit be7cb59dc5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 3 deletions

View file

@ -176,7 +176,11 @@ func (md Metadata) getRoleValues(role model.TagName) []string {
if len(values) == 0 {
return nil
}
if conf := model.TagRolesConf(); len(conf.Split) > 0 {
conf := model.TagMainMappings()[role]
if conf.Split == nil {
conf = model.TagRolesConf()
}
if len(conf.Split) > 0 {
values = conf.SplitTagValue(values)
return filterDuplicatedOrEmptyValues(values)
}
@ -193,7 +197,11 @@ func (md Metadata) getArtistValues(single, multi model.TagName) []string {
if len(vSingle) != 1 {
return vSingle
}
if conf := model.TagArtistsConf(); len(conf.Split) > 0 {
conf := model.TagMainMappings()[single]
if conf.Split == nil {
conf = model.TagArtistsConf()
}
if len(conf.Split) > 0 {
vSingle = conf.SplitTagValue(vSingle)
return filterDuplicatedOrEmptyValues(vSingle)
}

View file

@ -201,7 +201,7 @@ func loadTagMappings() {
aliases = oldValue.Aliases
}
split := cfg.Split
if len(split) == 0 {
if split == nil {
split = oldValue.Split
}
c := TagConf{