Merge pull request #4401 from lllusion3469/tumblr_2048

tumblr: pick biggest image based on resolution
This commit is contained in:
evazion
2020-04-09 23:46:24 -05:00
committed by GitHub

View File

@@ -46,7 +46,11 @@ module Sources::Strategies
case post[:type]
when "photo"
list += post[:photos].map { |photo| photo[:original_size][:url] }
list += post[:photos].map do |photo|
sizes = [photo[:original_size]] + photo[:alt_sizes]
biggest = sizes.max_by { |x| x[:width] * x[:height] }
biggest[:url]
end
when "video"
list += [post[:video_url]]