diff options
author | the-black-eagle <g.moore@gmx.co.uk> | 2024-08-10 08:38:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-10 08:38:11 +0100 |
commit | c5e4f59a74397a08ce35e3d45e12ad98577e1eb1 (patch) | |
tree | 7411aa704d91b8b46f2203a77ead31dd2fe5304c | |
parent | ec4eb1979b807d7bd83b04589a88121d165be435 (diff) | |
parent | c6437bca3fbb5e10a98817604cbfb2671cf7eeff (diff) |
Merge pull request #25557 from the-black-eagle/omega_fix_artistsort
[MUSIC] Fix separators so that artist sortnames split correctly
-rw-r--r-- | xbmc/music/Song.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/xbmc/music/Song.cpp b/xbmc/music/Song.cpp index 93b2156d7b..4446224602 100644 --- a/xbmc/music/Song.cpp +++ b/xbmc/music/Song.cpp @@ -91,12 +91,13 @@ void CSong::SetArtistCredits(const std::vector<std::string>& names, const std::v //Split the artist sort string to try and get sort names for individual artists std::vector<std::string> artistSort = StringUtils::Split(strArtistSort, CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_musicItemSeparator); + // Vector of possible separators in the order least likely to be part of artist name + static const std::vector<std::string> separators{ + " feat. ", " ft. ", " Feat. ", " Ft. ", ";", ":", "|", "#", "/", " with ", "&"}; + if (!mbids.empty()) { // Have musicbrainz artist info, so use it - // Vector of possible separators in the order least likely to be part of artist name - const std::vector<std::string> separators{ " feat. ", " ft. ", " Feat. "," Ft. ", ";", ":", "|", "#", "/", " with ", ",", "&" }; - // Establish tag consistency - do the number of musicbrainz ids and number of names in hints or artist match if (mbids.size() != artistHints.size() && mbids.size() != names.size()) { @@ -147,7 +148,7 @@ void CSong::SetArtistCredits(const std::vector<std::string>& names, const std::v // Try to get number of artist sort names and musicbrainz ids to match. Split sort names // further using multiple possible delimiters, over single separator applied in Tag loader if (artistSort.size() != mbids.size()) - artistSort = StringUtils::SplitMulti(artistSort, { ";", ":", "|", "#" }); + artistSort = StringUtils::SplitMulti(artistSort, separators); for (size_t i = 0; i < mbids.size(); i++) { @@ -185,7 +186,7 @@ void CSong::SetArtistCredits(const std::vector<std::string>& names, const std::v if (artistSort.size() != artists.size()) // Split artist sort names further using multiple possible delimiters, over single separator applied in Tag loader - artistSort = StringUtils::SplitMulti(artistSort, { ";", ":", "|", "#" }); + artistSort = StringUtils::SplitMulti(artistSort, separators); for (size_t i = 0; i < artists.size(); i++) { |