From c4a403afca7dd4fa3567c78efdcfb78b718cf97f Mon Sep 17 00:00:00 2001 From: lllusion3469 <31420484+lllusion3469@users.noreply.github.com> Date: Sun, 10 May 2020 21:42:00 +0200 Subject: [PATCH] deviantart: remove unreachable else api_deviation is either #blank? (if condition) or #present? was also part of eba6440b8ba440b4007c4eab2d7840419ada5a85 --- app/logical/sources/strategies/deviant_art.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/logical/sources/strategies/deviant_art.rb b/app/logical/sources/strategies/deviant_art.rb index 1f55c66cb..663da15b0 100644 --- a/app/logical/sources/strategies/deviant_art.rb +++ b/app/logical/sources/strategies/deviant_art.rb @@ -88,7 +88,7 @@ module Sources url elsif api_deviation[:is_downloadable] api_download[:src] - elsif api_deviation.present? + else src = api_deviation.dig(:content, :src) if deviation_id && deviation_id.to_i <= 790677560 && src =~ /^https:\/\/images-wixmp-/ && src !~ /\.gif\?/ src = src.sub(%r!(/f/[a-f0-9-]+/[a-f0-9-]+)!, '/intermediary\1') @@ -97,8 +97,6 @@ module Sources src = src.sub(%r!\Ahttps?://orig\d+\.deviantart\.net!i, "http://origin-orig.deviantart.net") src = src.gsub(%r!q_\d+,strp!, "q_100") src - else - raise "Couldn't find image url" # this should never happen end end