mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 15:42:24 -05:00
tests are passing, but there's still much to be done
This commit is contained in:
parent
f61c3ddcf7
commit
dccf21dd87
18 changed files with 259 additions and 170 deletions
|
|
@ -32,6 +32,7 @@ import (
|
|||
"github.com/superseriousbusiness/gotosocial/internal/ap"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/id"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/media"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/transport"
|
||||
)
|
||||
|
||||
|
|
@ -256,16 +257,16 @@ func (d *deref) fetchHeaderAndAviForAccount(ctx context.Context, targetAccount *
|
|||
return err
|
||||
}
|
||||
|
||||
media, err := d.mediaManager.ProcessMedia(ctx, data, targetAccount.ID, targetAccount.AvatarRemoteURL)
|
||||
avatar := true
|
||||
processingMedia, err := d.mediaManager.ProcessMedia(ctx, data, targetAccount.ID, &media.AdditionalInfo{
|
||||
RemoteURL: &targetAccount.AvatarRemoteURL,
|
||||
Avatar: &avatar,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := media.SetAsAvatar(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
targetAccount.AvatarMediaAttachmentID = media.AttachmentID()
|
||||
targetAccount.AvatarMediaAttachmentID = processingMedia.AttachmentID()
|
||||
}
|
||||
|
||||
if targetAccount.HeaderRemoteURL != "" && (targetAccount.HeaderMediaAttachmentID == "" || refresh) {
|
||||
|
|
@ -279,16 +280,16 @@ func (d *deref) fetchHeaderAndAviForAccount(ctx context.Context, targetAccount *
|
|||
return err
|
||||
}
|
||||
|
||||
media, err := d.mediaManager.ProcessMedia(ctx, data, targetAccount.ID, targetAccount.HeaderRemoteURL)
|
||||
header := true
|
||||
processingMedia, err := d.mediaManager.ProcessMedia(ctx, data, targetAccount.ID, &media.AdditionalInfo{
|
||||
RemoteURL: &targetAccount.HeaderRemoteURL,
|
||||
Header: &header,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := media.SetAsHeader(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
targetAccount.HeaderMediaAttachmentID = media.AttachmentID()
|
||||
targetAccount.HeaderMediaAttachmentID = processingMedia.AttachmentID()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue