Skip to content

Commit

Permalink
fix gmusic putting remixer with artist
Browse files Browse the repository at this point in the history
  • Loading branch information
dogatech committed Jun 25, 2023
1 parent b7c57e4 commit bc9093d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions be/src/MusicManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> 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
Expand Down Expand Up @@ -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<std::string> 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);

Expand Down
2 changes: 1 addition & 1 deletion fe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit bc9093d

Please sign in to comment.