Merge pull request #3373 from evazion/fix-3368

Fix #3368: "Fetch source data" on /uploads/new doesn't fetch artist tag
This commit is contained in:
Albert Yi
2017-11-15 10:58:52 -08:00
committed by GitHub
10 changed files with 83 additions and 105 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