mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-24 00:54:02 -05:00
Fixed duplicating URL of photo type of oEmbed (#5763)
This commit is contained in:
parent
2bcc81700c
commit
3dce6cbbd7
@ -74,6 +74,9 @@ class FetchLinkCardService < BaseService
|
|||||||
|
|
||||||
return false unless response.respond_to?(:type)
|
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.type = response.type
|
||||||
@card.title = response.respond_to?(:title) ? response.title : ''
|
@card.title = response.respond_to?(:title) ? response.title : ''
|
||||||
@card.author_name = response.respond_to?(:author_name) ? response.author_name : ''
|
@card.author_name = response.respond_to?(:author_name) ? response.author_name : ''
|
||||||
|
Loading…
Reference in New Issue
Block a user