Instead of using spoiler boolean and spoiler_text, simply check for non-blank spoiler_text
Federate spoiler_text using warning attribute on <content /> instead of a <category term="spoiler" /> Clean up schema file from accidental development migrations
This commit is contained in:
parent
f8da0dd490
commit
999cde94a6
23 changed files with 159 additions and 173 deletions
|
@ -9,7 +9,7 @@ class FetchLinkCardService < BaseService
|
|||
|
||||
response = http_client.get(url)
|
||||
|
||||
return if response.code != 200
|
||||
return if response.code != 200 || response.mime_type != 'text/html'
|
||||
|
||||
page = Nokogiri::HTML(response.to_s)
|
||||
card = PreviewCard.where(status: status).first_or_initialize(status: status, url: url)
|
||||
|
@ -18,6 +18,8 @@ class FetchLinkCardService < BaseService
|
|||
card.description = meta_property(page, 'og:description') || meta_property(page, 'description')
|
||||
card.image = URI.parse(meta_property(page, 'og:image')) if meta_property(page, 'og:image')
|
||||
|
||||
return if card.title.blank?
|
||||
|
||||
card.save_with_optional_image!
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue