mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-07 02:11:04 +00:00
Use larger_media_format?
to determine player usage
This commit is contained in:
parent
89bdf9b535
commit
1085b730e0
|
@ -1,5 +1,6 @@
|
|||
-# locals(status:, account:)
|
||||
|
||||
- if status.non_sensitive_with_media? || (status.with_media? && Setting.preview_sensitive_media)
|
||||
- player_card = false
|
||||
- status.ordered_media_attachments.each do |media|
|
||||
- if media.image?
|
||||
= opengraph 'og:image', full_asset_url(media.file.url(:original))
|
||||
|
@ -10,7 +11,6 @@
|
|||
- if media.description.present?
|
||||
= opengraph 'og:image:alt', media.description
|
||||
- elsif media.video? || media.gifv?
|
||||
- player_card = true
|
||||
= opengraph 'og:image', full_asset_url(media.file.url(:small))
|
||||
= opengraph 'og:image:type', 'image/png'
|
||||
- unless media.file.meta.nil?
|
||||
|
@ -28,7 +28,6 @@
|
|||
= opengraph 'twitter:player:width', media.file.meta.dig('original', 'width')
|
||||
= opengraph 'twitter:player:height', media.file.meta.dig('original', 'height')
|
||||
- elsif media.audio?
|
||||
- player_card = true
|
||||
= opengraph 'og:image', full_asset_url(account.avatar.url(:original))
|
||||
= opengraph 'og:image:width', '400'
|
||||
= opengraph 'og:image:height', '400'
|
||||
|
@ -40,7 +39,7 @@
|
|||
= opengraph 'twitter:player:stream:content_type', media.file_content_type
|
||||
= opengraph 'twitter:player:width', '670'
|
||||
= opengraph 'twitter:player:height', '380'
|
||||
- if player_card
|
||||
- if status.ordered_media_attachments.any?(&:larger_media_format?)
|
||||
= opengraph 'twitter:card', 'player'
|
||||
- else
|
||||
= opengraph 'twitter:card', 'summary_large_image'
|
||||
|
|
Loading…
Reference in New Issue
Block a user