From be7cb59dc5255b845f491326ce936e7ab6165819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deluan=20Quint=C3=A3o?= Date: Sat, 22 Mar 2025 12:34:35 -0400 Subject: [PATCH] fix(scanner): allow disabling splitting with the `Tags` config option (#3869) Signed-off-by: Deluan --- model/metadata/map_participants.go | 12 ++++++++++-- model/tag_mappings.go | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/model/metadata/map_participants.go b/model/metadata/map_participants.go index 9305d8791..a871f64fa 100644 --- a/model/metadata/map_participants.go +++ b/model/metadata/map_participants.go @@ -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) } diff --git a/model/tag_mappings.go b/model/tag_mappings.go index d8caa0c5d..d11b58fdc 100644 --- a/model/tag_mappings.go +++ b/model/tag_mappings.go @@ -201,7 +201,7 @@ func loadTagMappings() { aliases = oldValue.Aliases } split := cfg.Split - if len(split) == 0 { + if split == nil { split = oldValue.Split } c := TagConf{