From bc9093dff833e6a4013eb1fcb631f7cda6cc4bac Mon Sep 17 00:00:00 2001 From: dogatech Date: Sun, 25 Jun 2023 00:35:26 -0700 Subject: [PATCH] fix gmusic putting remixer with artist --- be/src/MusicManager.cpp | 21 ++++++++++++--------- fe/package.json | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/be/src/MusicManager.cpp b/be/src/MusicManager.cpp index efd7bf3..3d0b578 100644 --- a/be/src/MusicManager.cpp +++ b/be/src/MusicManager.cpp @@ -315,15 +315,6 @@ void MusicManager::writeTagsToSong(Song* song) { // so we remove it since it rarely matches in practice. boost::regex featRegex(" [(]ft[.] .*"); updatedSong->setArtist(boost::regex_replace(lastSongFixed->getArtist(), featRegex, "")); - } else { - // youtube music adds featuring and remixers to artists, so we remove it possibly here - std::vector artists; - boost::split(artists, updatedSong->getArtist(), boost::is_any_of(",")); - for (size_t i = 1; i < artists.size(); ++i) { - if (updatedSong->getTitle().find(trim_copy(artists[i])) == std::string::npos) { - artists[0] += ", " + artists[i]; - } - } } if (song.getTrack().length() == 0) { int trackNum = atoi(lastSongFixed->getTrack().c_str()); // returns 0 on error @@ -389,6 +380,18 @@ void MusicManager::writeTagsToSong(Song* song) { } } + // youtube music adds featuring and remixers to artists, so we remove it possibly here + { + std::vector artists; + boost::split(artists, updatedSong->getArtist(), boost::is_any_of(",")); + for (size_t i = 1; i < artists.size(); ++i) { + if (updatedSong->getTitle().find(trim_copy(artists[i])) == std::string::npos) { + artists[0] += ", " + artists[i]; + } + } + updatedSong->setArtist(artists[0]); + } + // copy remixer copyRemixer(updatedSong); diff --git a/fe/package.json b/fe/package.json index 760fba2..8b804d3 100644 --- a/fe/package.json +++ b/fe/package.json @@ -2,7 +2,7 @@ "name": "SoulSifter", "version": "1.4.0", "description": "DJ & music organization app.", - "build": 2967, + "build": 2969, "main": "main.js", "scripts": { "fe:build": "vite build",