def lookup(query, fetch:)
cleaned = query.to_s.strip
return NO_LYRICS_MESSAGE if cleaned.empty?
match = SingSources.parse_query(cleaned)
unless match
suggest_json = fetch.call(SingSources.build_suggest_url(cleaned))
match = SingSources.parse_suggest_response(suggest_json)
return NO_LYRICS_MESSAGE unless match
end
lyrics = SingSources.fetch_lyrics_for_match(match, fetch: fetch)
return NO_LYRICS_MESSAGE unless lyrics
SingFormat.format_lyrics(match[:artist], match[:title], lyrics)
rescue StandardError
NO_LYRICS_MESSAGE
end