Save web app metadata explicitly

This commit is contained in:
Râu Cao 2023-10-23 16:43:18 +02:00
parent e508407df4
commit e964e7e52c
Signed by: raucao
GPG Key ID: 15E65F399D084BA9
2 changed files with 2 additions and 2 deletions

View File

@ -12,8 +12,6 @@ class AppCatalog::WebApp < ApplicationRecord
validates :url, format: { with: URI.regexp },
if: Proc.new { |a| a.url.present? }
before_create :update_metadata
def update_metadata
AppCatalogManager::UpdateMetadata.call(self)
end

View File

@ -24,6 +24,8 @@ 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)