diff --git a/app/logical/sources/site.rb b/app/logical/sources/site.rb index 5e586cd9c..2c5f75b9e 100644 --- a/app/logical/sources/site.rb +++ b/app/logical/sources/site.rb @@ -3,8 +3,8 @@ module Sources class Site attr_reader :url, :strategy - delegate :get, :get_size, :site_name, :artist_name, - :profile_url, :image_url, :tags, :artist_record, :unique_id, + delegate :get, :get_size, :site_name, :artist_name, + :profile_url, :image_url, :tags, :artists, :unique_id, :file_url, :ugoira_frame_data, :ugoira_content_type, :image_urls, :artist_commentary_title, :artist_commentary_desc, :dtext_artist_commentary_title, :dtext_artist_commentary_desc, @@ -46,14 +46,13 @@ module Sources def to_h return { :artist_name => artist_name, + :artists => artists.as_json(include: :sorted_urls), :profile_url => profile_url, :image_url => image_url, :image_urls => image_urls, :normalized_for_artist_finder_url => normalize_for_artist_finder!, :tags => tags, :translated_tags => translated_tags, - :danbooru_name => artist_record.try(:first).try(:name), - :danbooru_id => artist_record.try(:first).try(:id), :unique_id => unique_id, :artist_commentary => { :title => artist_commentary_title, diff --git a/app/logical/sources/strategies/base.rb b/app/logical/sources/strategies/base.rb index 3b0ec8096..6e052467e 100644 --- a/app/logical/sources/strategies/base.rb +++ b/app/logical/sources/strategies/base.rb @@ -64,12 +64,8 @@ module Sources artist_name end - def artist_record - if artist_name.present? - Artist.other_names_match(artist_name) - else - nil - end + def artists + Artist.find_artists(url, referer_url) end def image_urls