mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Merge 74007a9c4f
into a50c8e951f
This commit is contained in:
commit
b3d0501ac2
1 changed files with 2 additions and 2 deletions
|
@ -147,8 +147,8 @@ class FetchLinkCardService < BaseService
|
||||||
return if html.nil?
|
return if html.nil?
|
||||||
|
|
||||||
link_details_extractor = LinkDetailsExtractor.new(@url, @html, @html_charset)
|
link_details_extractor = LinkDetailsExtractor.new(@url, @html, @html_charset)
|
||||||
provider = PreviewCardProvider.matching_domain(Addressable::URI.parse(link_details_extractor.canonical_url).normalized_host)
|
provider_trendable = Trends.skip_review? || PreviewCardProvider.matching_domain(Addressable::URI.parse(link_details_extractor.canonical_url).normalized_host)&.trendable?
|
||||||
linked_account = ResolveAccountService.new.call(link_details_extractor.author_account, suppress_errors: true) if link_details_extractor.author_account.present? && provider&.trendable?
|
linked_account = ResolveAccountService.new.call(link_details_extractor.author_account, suppress_errors: true) if link_details_extractor.author_account.present? && provider_trendable
|
||||||
|
|
||||||
@card = PreviewCard.find_or_initialize_by(url: link_details_extractor.canonical_url) if link_details_extractor.canonical_url != @card.url
|
@card = PreviewCard.find_or_initialize_by(url: link_details_extractor.canonical_url) if link_details_extractor.canonical_url != @card.url
|
||||||
@card.assign_attributes(link_details_extractor.to_preview_card_attributes)
|
@card.assign_attributes(link_details_extractor.to_preview_card_attributes)
|
||||||
|
|
Loading…
Reference in a new issue