Closed dm0896665 closed 2 years ago
Correct me if I'm wrong/misunderstanding, but I think the only time we default to the "?" image is when the census doesn't have an image_id or image_path at all for that weapon. The only way I think this could work is instead of default to image_id => 3, image_path => ".../3.png", default to something like -1 for image_id and a blank string for image_path - would that work for triggering onerror
@dm0896665 ?
Ah okay. I thought we had it already checking if it existed. My mistake. Yeah having any image id that doesn't exist should be fine. onerror
is triggered when the image can't be found.
Edit the
get_weapons.exs
script so that it keeps the originalimage_path
even if that path doesn't exist yet.This will allow the
onerror
to take over and show the unknown vehicle/infantry weapon instead of a question mark. It will also let the website stay more up-to-date by getting the proper image as it gets added by daybreak instead of needing to rerun the script constantly to get the images updated.