about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorJenkins <jenkins@jenkins.ninjawedding.org>2017-12-07 04:17:14 +0000
committerJenkins <jenkins@jenkins.ninjawedding.org>2017-12-07 04:17:14 +0000
commit744447b3c04d7806e383f0d1ad7a10c73bd667ef (patch)
tree640d74c3586dfe3114b7db3fdb97e2e3d8490843 /app/services
parentde5620995175b7c1c0fc458bd78c12d8c5860aad (diff)
parent0c4ca3e549865623fdd35764915814acc8a595e1 (diff)
Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master
Diffstat (limited to 'app/services')
-rw-r--r--app/services/fetch_link_card_service.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/app/services/fetch_link_card_service.rb b/app/services/fetch_link_card_service.rb
index 37cf75379..cec96d927 100644
--- a/app/services/fetch_link_card_service.rb
+++ b/app/services/fetch_link_card_service.rb
@@ -74,9 +74,6 @@ class FetchLinkCardService < BaseService
 
     return false unless response.respond_to?(:type)
 
-    # The photo will change the URL. So, to avoid duplication of URLs, PreviewCard needs to be checked again.
-    @card = PreviewCard.find_by(url: response.url) || @card if response.type == 'photo'
-
     @card.type          = response.type
     @card.title         = response.respond_to?(:title)         ? response.title         : ''
     @card.author_name   = response.respond_to?(:author_name)   ? response.author_name   : ''
@@ -90,9 +87,9 @@ class FetchLinkCardService < BaseService
     when 'link'
       @card.image = URI.parse(response.thumbnail_url) if response.respond_to?(:thumbnail_url)
     when 'photo'
-      @card.url    = response.url
-      @card.width  = response.width.presence  || 0
-      @card.height = response.height.presence || 0
+      @card.embed_url = response.url
+      @card.width     = response.width.presence  || 0
+      @card.height    = response.height.presence || 0
     when 'video'
       @card.width  = response.width.presence  || 0
       @card.height = response.height.presence || 0