sources: fix dummy names being suggested as other names.

Fix placeholder names like weibo_1234, bilibili_1234, nijie1234, and nicoseiga1234 being suggested
as Other Names when creating new artist entries. These are meant to be placeholders for the tag
name, not used as other names.
This commit is contained in:
evazion
2022-11-21 14:37:50 -06:00
parent 5559219f0a
commit 2d83500885
10 changed files with 44 additions and 8 deletions

View File

@@ -90,6 +90,10 @@ module Source
"bilibili_#{artist_id}"
end
def other_names
[artist_name].compact
end
def artist_id
artist_id_from_data || parsed_url.artist_id || parsed_referer&.artist_id
end

View File

@@ -40,7 +40,7 @@ module Source
end
def profile_url
"https://seiga.nicovideo.jp/user/illust/#{api_client.user_id}" if api_client&.user_id.present?
"https://seiga.nicovideo.jp/user/illust/#{artist_id}" if artist_id.present?
end
def artist_name
@@ -67,8 +67,11 @@ module Source
end
def tag_name
return if api_client&.user_id.blank?
"nicoseiga#{api_client.user_id}"
"nicoseiga_#{artist_id}" if artist_id.present?
end
def other_names
[artist_name].compact
end
def tags
@@ -95,6 +98,10 @@ module Source
parsed_url.manga_id || parsed_referer&.manga_id
end
def artist_id
api_client&.user_id
end
def http
if parsed_url.oekaki_id.present?
super.with_legacy_ssl

View File

@@ -78,7 +78,11 @@ module Source
end
def tag_name
"nijie" + artist_id.to_s
"nijie_#{artist_id}" if artist_id.present?
end
def other_names
[artist_name].compact
end
def self.to_dtext(text)

View File

@@ -56,7 +56,11 @@ module Source
end
def tag_name
nil
"tinami_#{user_id}" if user_id.present?
end
def other_names
[artist_name].compact
end
def artist_name

View File

@@ -59,6 +59,10 @@ module Source
api_response&.dig("user", "screen_name")
end
def other_names
[artist_name].compact
end
def artist_id
parsed_url.artist_short_id || parsed_referer&.artist_short_id || api_response&.dig("user", "id")
end