sources: rename Sources::Strategies to Source::Extractor.

Rename Sources::Strategies to Source::Extractor. A Source::Extractor
represents a thing that extracts information from a given URL.
This commit is contained in:
evazion
2022-03-24 03:05:10 -05:00
parent 34aa22f90b
commit d9d3c1dfe4
63 changed files with 622 additions and 606 deletions

View File

@@ -156,7 +156,7 @@ class Artist < ApplicationRecord
end
if source.present?
artist = Sources::Strategies.find(source).new_artist
artist = Source::Extractor.find(source).new_artist
artist.attributes = params
else
artist = Artist.new(params)
@@ -252,7 +252,7 @@ class Artist < ApplicationRecord
elsif query.include?("*")
where(id: ArtistURL.where_like(:url, query).select(:artist_id))
elsif query =~ %r{\Ahttps?://}i
url = Sources::Strategies.find(query).profile_url || query
url = Source::Extractor.find(query).profile_url || query
ArtistFinder.find_artists(url)
else
where(id: ArtistURL.where_like(:url, "*#{query}*").select(:artist_id))