mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 23:32:24 -05:00
[feature] Media attachment placeholders (#2331)
* [feature] Use placeholders for unknown media types * fix read of underreported small files * switch to reduce nesting * simplify cleanup
This commit is contained in:
parent
c7ecab9e6f
commit
ba9d6b467a
41 changed files with 1472 additions and 841 deletions
|
|
@ -123,9 +123,14 @@ func (og *ogMeta) withStatus(status *apimodel.Status) *ogMeta {
|
|||
|
||||
if !status.Sensitive && len(status.MediaAttachments) > 0 {
|
||||
a := status.MediaAttachments[0]
|
||||
og.Image = a.PreviewURL
|
||||
|
||||
og.ImageWidth = strconv.Itoa(a.Meta.Small.Width)
|
||||
og.ImageHeight = strconv.Itoa(a.Meta.Small.Height)
|
||||
|
||||
if a.PreviewURL != nil {
|
||||
og.Image = *a.PreviewURL
|
||||
}
|
||||
|
||||
if a.Description != nil {
|
||||
og.ImageAlt = *a.Description
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue