@@ -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" ));
0 commit comments