mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 02:52:26 -05:00
rework media processing a little bit (#191)
* rework media processing a little bit * review changes
This commit is contained in:
parent
ff05046df7
commit
2b14b20802
13 changed files with 486 additions and 166 deletions
|
|
@ -384,10 +384,7 @@ func ExtractAttachment(i Attachmentable) (*gtsmodel.MediaAttachment, error) {
|
|||
attachment.RemoteURL = attachmentURL.String()
|
||||
|
||||
mediaType := i.GetActivityStreamsMediaType()
|
||||
if mediaType == nil {
|
||||
return nil, errors.New("no media type")
|
||||
}
|
||||
if mediaType.Get() == "" {
|
||||
if mediaType == nil || mediaType.Get() == "" {
|
||||
return nil, errors.New("no media type")
|
||||
}
|
||||
attachment.File.ContentType = mediaType.Get()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue