about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
Diffstat (limited to 'app/services')
-rw-r--r--app/services/fetch_link_card_service.rb8
-rw-r--r--app/services/process_feed_service.rb4
2 files changed, 6 insertions, 6 deletions
diff --git a/app/services/fetch_link_card_service.rb b/app/services/fetch_link_card_service.rb
index dec4aabd6..ec9b5226e 100644
--- a/app/services/fetch_link_card_service.rb
+++ b/app/services/fetch_link_card_service.rb
@@ -84,10 +84,10 @@ class FetchLinkCardService < BaseService
 
     page = Nokogiri::HTML(response.to_s)
 
-    card.type        = :link
-    card.title       = meta_property(page, 'og:title') || page.at_xpath('//title')&.content
-    card.description = meta_property(page, 'og:description') || meta_property(page, 'description')
-    card.image       = URI.parse(Addressable::URI.parse(meta_property(page, 'og:image')).normalize.to_s) if meta_property(page, 'og:image')
+    card.type             = :link
+    card.title            = meta_property(page, 'og:title') || page.at_xpath('//title')&.content
+    card.description      = meta_property(page, 'og:description') || meta_property(page, 'description')
+    card.image_remote_url = meta_property(page, 'og:image') if meta_property(page, 'og:image')
 
     return if card.title.blank?
 
diff --git a/app/services/process_feed_service.rb b/app/services/process_feed_service.rb
index 04d6a100f..28ace7ae9 100644
--- a/app/services/process_feed_service.rb
+++ b/app/services/process_feed_service.rb
@@ -239,8 +239,8 @@ class ProcessFeedService < BaseService
 
         begin
           media.file_remote_url = link['href']
-          media.save
-        rescue OpenURI::HTTPError, OpenSSL::SSL::SSLError, Paperclip::Errors::NotIdentifiedByImageMagickError
+          media.save!
+        rescue ActiveRecord::RecordInvalid
           next
         end
       end