|
|
|
|
@ -20,6 +20,7 @@ |
|
|
|
|
|
|
|
|
|
#include "lastfm_service.h" |
|
|
|
|
|
|
|
|
|
#include <boost/algorithm/string/replace.hpp> |
|
|
|
|
#include <boost/algorithm/string/trim.hpp> |
|
|
|
|
#include <boost/locale/conversion.hpp> |
|
|
|
|
#include <fstream> |
|
|
|
|
@ -118,6 +119,10 @@ Service::Result ArtistInfo::processData(const std::string &data) |
|
|
|
|
std::string url = what[1], wiki; |
|
|
|
|
// unescape &s
|
|
|
|
|
unescapeHtmlEntities(url); |
|
|
|
|
// fill in language info since url points to english version.
|
|
|
|
|
const auto &lang = m_arguments["lang"]; |
|
|
|
|
if (!lang.empty()) |
|
|
|
|
boost::replace_first(url, "last.fm/music/", "last.fm/" + lang + "/music/"); |
|
|
|
|
// ...try to get the content of it...
|
|
|
|
|
CURLcode code = Curl::perform(wiki, url, "", true); |
|
|
|
|
|
|
|
|
|
@ -145,7 +150,10 @@ Service::Result ArtistInfo::processData(const std::string &data) |
|
|
|
|
result.second += desc; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
result.second += "No description available for this artist."; |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
|