pixiv: fix failure to upload bad pixiv id images (fix #4031)

Bug: Uploading bad pixiv id images failed because the pixiv strategy
raised a BadIDError exception when the upload service checked for the
ugoira frame data.
This commit is contained in:
evazion
2019-01-03 18:01:20 -06:00
parent 7478c7a913
commit 04d5b16da7
3 changed files with 12 additions and 5 deletions

View File

@@ -326,6 +326,8 @@ module Sources
end
return metadata.moniker
rescue PixivApiClient::BadIDError
nil
end
memoize :moniker
@@ -344,6 +346,8 @@ module Sources
def ugoira_frame_data
return metadata.json.dig("metadata", "frames")
rescue PixivApiClient::BadIDError
nil
end
memoize :ugoira_frame_data

View File

@@ -229,7 +229,7 @@ class UploadService
retry
end
if download.data[:ugoira_frame_data]
if download.data[:ugoira_frame_data].present?
upload.context = {
"ugoira" => {
"frame_data" => download.data[:ugoira_frame_data],