tinami: return nothing if getting the full image fails.

Fix to make sure `image_urls` returns an empty array instead of `[nil]`
if grabbing the full image URL fails for whatever reason.
This commit is contained in:
evazion
2022-03-19 23:31:37 -05:00
parent 7f58cfbe5e
commit 71f42d67a7

View File

@@ -15,11 +15,11 @@ module Sources
# http://www.tinami.com/view/1087268 (single image)
elsif page&.css("img.captify")&.size.to_i == 1
[full_image_url]
[full_image_url].compact
# http://www.tinami.com/view/1087270 (multiple images)
elsif image_sub_ids.present?
image_sub_ids.map { |sub_id| full_image_url(sub_id) }
image_sub_ids.map { |sub_id| full_image_url(sub_id) }.compact
# http://www.tinami.com/view/1087271 (multiple images)
elsif nv_body_image_urls.present?