Save WebApp before fetching icons

This commit is contained in:
Râu Cao 2024-02-08 13:02:08 +01:00
parent 411587456b
commit a7410058fa
Signed by: raucao
GPG Key ID: 37036C356E56CC51

View File

@ -18,6 +18,8 @@ module AppCatalogManager
@app.metadata[prop] = metadata.send(prop) if prop
end
@app.save!
if icon = metadata.select_icon(sizes: "256x256") ||
icon = metadata.select_icon(sizes: "192x192")
attach_remote_image(:icon, icon)
@ -27,8 +29,6 @@ module AppCatalogManager
if apple_touch_icon = metadata.select_icon(purpose: "apple-touch-icon")
attach_remote_image(:apple_touch_icon, apple_touch_icon)
end
@app.save!
rescue Manifique::Error => e
msg = "Fetching web app manifest failed for #{e.url}: #{e.type}"
Rails.logger.warn(msg)