diff options
author | the-black-eagle <g.moore@gmx.co.uk> | 2024-07-29 19:31:41 +0100 |
---|---|---|
committer | the-black-eagle <g.moore@gmx.co.uk> | 2024-07-29 19:31:41 +0100 |
commit | c6437bca3fbb5e10a98817604cbfb2671cf7eeff (patch) | |
tree | 198cd5af91254201af9bc2d177bcf6a8e562028b | |
parent | 830cb39395e572d96a61db5c13510da45f256cd3 (diff) |
[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++) { |