Skip to content

Commit ed6df2d

Browse files
author
dogatech
committed
fix bug when setting featured artist of new songs
1 parent 71a5147 commit ed6df2d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

be/src/MusicVideoService.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ vector<string> MusicVideoService::downloadAudio(const string& url) {
148148
string date;
149149
if (url.find("music.youtube") != std::string::npos) {
150150
// youtube music
151+
LOG(DEBUG) << "title = " << ptree.get<string>("track");
151152
song->setTitle(ptree.get<string>("track"));
152153
LOG(DEBUG) << "artist = " << ptree.get<string>("artist");
153154
LOG(DEBUG) << "creator = " << ptree.get<string>("creator");
@@ -162,17 +163,20 @@ vector<string> MusicVideoService::downloadAudio(const string& url) {
162163
artists[0] += ", " + artists[i];
163164
}
164165
}
165-
song->setArtist(artists[0]);
166+
song->setArtist(trim_copy(artists[0]));
167+
LOG(DEBUG) << "artist after removing remixer = " << song->getArtist();
166168
// update featuring
167169
if (song->getArtist().rfind(ptree.get<string>("channel"), 0) == 0
168-
&& ptree.get<string>("artist") != ptree.get<string>("channel")) {
170+
&& song->getArtist() != ptree.get<string>("channel")) {
169171
song->setArtist(ptree.get<string>("channel") + " (ft. " + song->getArtist().substr(ptree.get<string>("channel").length() + 2) + ")");
170172
}
173+
LOG(DEBUG) << "artist after updating featuring = " << song->getArtist();
171174
// consolidate double spaces to a single space
172175
string s = song->getArtist();
173176
std::string::iterator new_end = std::unique(s.begin(), s.end(), bothAre<' '>);
174177
s.erase(new_end, s.end());
175178
song->setArtist(s);
179+
LOG(DEBUG) << "artist after removing double spaces = " << song->getArtist();
176180
}
177181
album->setName(ptree.get<string>("album"));
178182
song->setTrack(ptree.get<string>("playlist_index"));

fe/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "SoulSifter",
33
"version": "1.6.1",
44
"description": "DJ & music organization app.",
5-
"build": 3068,
5+
"build": 3070,
66
"main": "main.js",
77
"scripts": {
88
"fe:build": "vite build",
@@ -49,4 +49,4 @@
4949
"url": "^0.11.0",
5050
"wavesurfer.js": "^6.6.3"
5151
}
52-
}
52+
}

0 commit comments

Comments
 (0)