/source.json: do artist lookup and return matches in artists.

This commit is contained in:
evazion
2017-11-14 20:24:00 -06:00
parent 58018aeb2b
commit cbd68ac91b
2 changed files with 5 additions and 10 deletions

View File

@@ -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,

View File

@@ -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