From a845477cba155b9677b4ba43b170fa100dd85cc9 Mon Sep 17 00:00:00 2001 From: nonamethanks Date: Tue, 14 Sep 2021 11:32:24 +0200 Subject: [PATCH] Sources: fix artist_name not being caught in skeb and weibo --- app/logical/sources/strategies/skeb.rb | 2 +- app/logical/sources/strategies/weibo.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/logical/sources/strategies/skeb.rb b/app/logical/sources/strategies/skeb.rb index 12a9ef877..6f12e0209 100644 --- a/app/logical/sources/strategies/skeb.rb +++ b/app/logical/sources/strategies/skeb.rb @@ -83,7 +83,7 @@ module Sources end def artist_name - url[PROFILE_URL, :artist_name] + urls.map { |u| u[PROFILE_URL, :artist_name] }.compact.first end def display_name diff --git a/app/logical/sources/strategies/weibo.rb b/app/logical/sources/strategies/weibo.rb index 3dfa5ac96..fea8b0f55 100644 --- a/app/logical/sources/strategies/weibo.rb +++ b/app/logical/sources/strategies/weibo.rb @@ -137,6 +137,10 @@ module Sources "https://www.weibo.com/p/#{artist_long_id}" end + def artist_name + api_response&.dig("user", "screen_name") + end + def artist_commentary_desc return if api_response.blank?