Skip to content

Commit

Permalink
Fix Metal Archives possibly returning 'lyrics not available'
Browse files Browse the repository at this point in the history
Fixes #323
  • Loading branch information
jacquesh committed Jul 28, 2024
1 parent 588c1d5 commit 2469e42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ void OpenLyricsVersion::get_about_message(pfc::string_base & out)
" - If a source returns only one type you'll get that type regardless\n"
"- Fix the lyric editor sometimes responding badly to Ctrl-A/Ctrl-Backspace\n"
"- Fix possibly using the wrong background colour when changing FB2K colours\n"
"- Fix Metal Archives possibly returning 'lyrics not available'\n"
"- Many, many minor non-functional internal code improvements\n"
"\n";
out += "Version 1.9 (2024-06-12):\n"
Expand Down
4 changes: 4 additions & 0 deletions src/sources/metalarchives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ bool MetalArchivesSource::lookup(LyricDataRaw& data, abort_callback& abort)
const pugi::xml_document lyric_doc = load_html(content.c_str());
const std::string lyric_text = collect_all_text_to_string(lyric_doc);

if(lyric_text == "(lyrics not available)") {
return false;
}

data.text_bytes = string_to_raw_bytes(lyric_text);
data.source_path = std::move(url);
return !data.text_bytes.empty();
Expand Down

0 comments on commit 2469e42

Please sign in to comment.