artists: clean up artist finding logic.

Rename Artist#find_all_by_url to url_matches and drop previous
url_matches method, along with find_artists and search_for_profile.

Previously find_artists tried to lookup the url, referer url, and profile
url in turn until an artist match was found. This was wasteful, because
the source strategy already knows which url to lookup (usually the profile
url). If that url doesn't find a match, then the artist doesn't exist.
This commit is contained in:
evazion
2018-09-08 16:03:10 -05:00
parent 10ca4dd3ad
commit 583f8457f0
4 changed files with 14 additions and 57 deletions

View File

@@ -66,14 +66,6 @@ module Sources::Strategies
""
end
def artists
if profile_url.present?
Artist.find_artists(profile_url)
else
[]
end
end
def artist_name
return "" if api_response.blank?
api_response.attrs[:user][:screen_name]