rework media processing a little bit (#191)

* rework media processing a little bit

* review changes
This commit is contained in:
tobi 2021-09-04 14:02:01 +02:00 committed by GitHub
commit 2b14b20802
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 486 additions and 166 deletions

View file

@ -396,13 +396,10 @@ func (d *deref) populateStatusAttachments(ctx context.Context, status *gtsmodel.
attachments := []*gtsmodel.MediaAttachment{}
for _, a := range status.Attachments {
aURL, err := url.Parse(a.RemoteURL)
if err != nil {
l.Errorf("populateStatusAttachments: couldn't parse attachment url %s: %s", a.RemoteURL, err)
continue
}
a.AccountID = status.AccountID
a.StatusID = status.ID
attachment, err := d.GetRemoteAttachment(ctx, requestingUsername, aURL, status.AccountID, status.ID, a.File.ContentType)
attachment, err := d.GetRemoteAttachment(ctx, requestingUsername, a)
if err != nil {
l.Errorf("populateStatusAttachments: couldn't get remote attachment %s: %s", a.RemoteURL, err)
continue