Save web app metadata explicitly
This commit is contained in:
parent
e508407df4
commit
e964e7e52c
@ -12,8 +12,6 @@ class AppCatalog::WebApp < ApplicationRecord
|
|||||||
validates :url, format: { with: URI.regexp },
|
validates :url, format: { with: URI.regexp },
|
||||||
if: Proc.new { |a| a.url.present? }
|
if: Proc.new { |a| a.url.present? }
|
||||||
|
|
||||||
before_create :update_metadata
|
|
||||||
|
|
||||||
def update_metadata
|
def update_metadata
|
||||||
AppCatalogManager::UpdateMetadata.call(self)
|
AppCatalogManager::UpdateMetadata.call(self)
|
||||||
end
|
end
|
||||||
|
@ -24,6 +24,8 @@ module AppCatalogManager
|
|||||||
if apple_touch_icon = metadata.select_icon(purpose: "apple-touch-icon")
|
if apple_touch_icon = metadata.select_icon(purpose: "apple-touch-icon")
|
||||||
attach_remote_image(:apple_touch_icon, apple_touch_icon)
|
attach_remote_image(:apple_touch_icon, apple_touch_icon)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@app.save!
|
||||||
rescue Manifique::Error => e
|
rescue Manifique::Error => e
|
||||||
msg = "Fetching web app manifest failed for #{e.url}: #{e.type}"
|
msg = "Fetching web app manifest failed for #{e.url}: #{e.type}"
|
||||||
Rails.logger.warn(msg)
|
Rails.logger.warn(msg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user