Fall back to blank image if alt style has no preview image
This is currently crashing the Rainbow Pool when the Anniversary Techo would appear, because the asset seems to be missing? The SWF doesn't seem to exist, nor does its manifest.
This commit is contained in:
parent
217d25edab
commit
c4a7e7916f
1 changed files with 3 additions and 4 deletions
|
@ -62,11 +62,10 @@ class AltStyle < ApplicationRecord
|
||||||
"#{series_name} #{name}"
|
"#{series_name} #{name}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
EMPTY_IMAGE_URL = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
|
||||||
def preview_image_url
|
def preview_image_url
|
||||||
swf_asset = swf_assets.first
|
# Use the image URL for the first asset. Or, fall back to an empty image.
|
||||||
return nil if swf_asset.nil?
|
swf_assets.first&.image_url || EMPTY_IMAGE_URL
|
||||||
|
|
||||||
swf_asset.image_url
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Given a list of items, return how they look on this alt style.
|
# Given a list of items, return how they look on this alt style.
|
||||||
|
|
Loading…
Reference in a new issue