pixiv: fixup bug with fetching image_urls for bad_id posts.

Fix `image_urls` returning `[nil]` when fetching data for a image URL
that was bad_id. In that case `original_urls` is empty, so we fall back
to using the deleted image URL as-is.
This commit is contained in:
evazion
2022-03-08 23:47:45 -06:00
parent c989726313
commit 8a50148823

View File

@@ -43,7 +43,7 @@ module Sources
def image_urls
if is_ugoira?
[api_ugoira[:originalSrc]]
elsif parsed_url.image_url? && parsed_url.page
elsif parsed_url.image_url? && parsed_url.page && original_urls.present?
[original_urls[parsed_url.page]]
elsif parsed_url.image_url?
[parsed_url.to_s]