weibo: fix https://m.weibo.cn/detail/1234 urls not finding the artist.
Fix https://m.weibo.cn/detail/4506950043618873 type URLs not finding the artist because the profile_url method returned nil instead of the actual profile URL.
This commit is contained in:
@@ -53,13 +53,17 @@ module Sources
|
|||||||
end
|
end
|
||||||
|
|
||||||
def profile_url
|
def profile_url
|
||||||
profile_urls.first
|
"https://www.weibo.com/u/#{artist_id}" if artist_id.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def artist_name
|
def artist_name
|
||||||
api_response&.dig("user", "screen_name")
|
api_response&.dig("user", "screen_name")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def artist_id
|
||||||
|
parsed_url.artist_short_id || parsed_referer&.artist_short_id || api_response&.dig("user", "id")
|
||||||
|
end
|
||||||
|
|
||||||
def artist_commentary_desc
|
def artist_commentary_desc
|
||||||
return if api_response.blank?
|
return if api_response.blank?
|
||||||
|
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ module Sources
|
|||||||
|
|
||||||
assert_equal("https://www.weibo.com/5501756072/J2UNKfbqV", @site.page_url)
|
assert_equal("https://www.weibo.com/5501756072/J2UNKfbqV", @site.page_url)
|
||||||
assert_equal("https://www.weibo.com/5501756072/J2UNKfbqV", @site.canonical_url)
|
assert_equal("https://www.weibo.com/5501756072/J2UNKfbqV", @site.canonical_url)
|
||||||
|
assert_equal("https://www.weibo.com/u/5501756072", @site.profile_url)
|
||||||
assert_equal(%w[fgo Alter组], @site.tags.map(&:first))
|
assert_equal(%w[fgo Alter组], @site.tags.map(&:first))
|
||||||
assert_equal("阿尔托莉雅厨", @site.artist_name)
|
assert_equal("阿尔托莉雅厨", @site.artist_name)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user