From dff99c4b0beed85b3636311730944c9367df543d Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Fri, 25 Feb 2011 15:51:31 +0100 Subject: [PATCH] lyrics fetcher: skip lyricwiki if there's licence restriction on lyrics --- src/lyrics_fetcher.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lyrics_fetcher.cpp b/src/lyrics_fetcher.cpp index e64b2ed3..641f4ce5 100644 --- a/src/lyrics_fetcher.cpp +++ b/src/lyrics_fetcher.cpp @@ -125,12 +125,18 @@ LyricsFetcher::Result LyricwikiFetcher::fetch(const std::string &artist, const s result.second = msgNotFound; return result; } + data = unescapeHtmlUtf8(data); + if (data.find("Unfortunately, we are not licensed to display the full lyrics for this song at the moment.") != std::string::npos) + { + result.second = "Licence restriction"; + return result; + } Replace(data, "
", "\n"); StripHtmlTags(data); Trim(data); - result.second = unescapeHtmlUtf8(data); + result.second = data; result.first = true; } return result;