/source.json: do artist lookup and return matches in artists.
This commit is contained in:
@@ -4,7 +4,7 @@ module Sources
|
|||||||
class Site
|
class Site
|
||||||
attr_reader :url, :strategy
|
attr_reader :url, :strategy
|
||||||
delegate :get, :get_size, :site_name, :artist_name,
|
delegate :get, :get_size, :site_name, :artist_name,
|
||||||
:profile_url, :image_url, :tags, :artist_record, :unique_id,
|
:profile_url, :image_url, :tags, :artists, :unique_id,
|
||||||
:file_url, :ugoira_frame_data, :ugoira_content_type, :image_urls,
|
:file_url, :ugoira_frame_data, :ugoira_content_type, :image_urls,
|
||||||
:artist_commentary_title, :artist_commentary_desc,
|
:artist_commentary_title, :artist_commentary_desc,
|
||||||
:dtext_artist_commentary_title, :dtext_artist_commentary_desc,
|
:dtext_artist_commentary_title, :dtext_artist_commentary_desc,
|
||||||
@@ -46,14 +46,13 @@ module Sources
|
|||||||
def to_h
|
def to_h
|
||||||
return {
|
return {
|
||||||
:artist_name => artist_name,
|
:artist_name => artist_name,
|
||||||
|
:artists => artists.as_json(include: :sorted_urls),
|
||||||
:profile_url => profile_url,
|
:profile_url => profile_url,
|
||||||
:image_url => image_url,
|
:image_url => image_url,
|
||||||
:image_urls => image_urls,
|
:image_urls => image_urls,
|
||||||
:normalized_for_artist_finder_url => normalize_for_artist_finder!,
|
:normalized_for_artist_finder_url => normalize_for_artist_finder!,
|
||||||
:tags => tags,
|
:tags => tags,
|
||||||
:translated_tags => translated_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,
|
:unique_id => unique_id,
|
||||||
:artist_commentary => {
|
:artist_commentary => {
|
||||||
:title => artist_commentary_title,
|
:title => artist_commentary_title,
|
||||||
|
|||||||
@@ -64,12 +64,8 @@ module Sources
|
|||||||
artist_name
|
artist_name
|
||||||
end
|
end
|
||||||
|
|
||||||
def artist_record
|
def artists
|
||||||
if artist_name.present?
|
Artist.find_artists(url, referer_url)
|
||||||
Artist.other_names_match(artist_name)
|
|
||||||
else
|
|
||||||
nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def image_urls
|
def image_urls
|
||||||
|
|||||||
Reference in New Issue
Block a user