summaryrefslogtreecommitdiff
path: root/internal/processing/media/create.go
diff options
context:
space:
mode:
authorLibravatar tsmethurst <tobi.smethurst@protonmail.com>2022-01-08 17:17:01 +0100
committerLibravatar tsmethurst <tobi.smethurst@protonmail.com>2022-01-08 17:17:01 +0100
commitf61c3ddcf72ff689b9d253546c58d499b6fe6ac8 (patch)
treeb418d5a833f0e3b92b255e73efa98007eb8127ac /internal/processing/media/create.go
parentfurther refinements (diff)
downloadgotosocial-f61c3ddcf72ff689b9d253546c58d499b6fe6ac8.tar.xz
compiling now
Diffstat (limited to 'internal/processing/media/create.go')
-rw-r--r--internal/processing/media/create.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/internal/processing/media/create.go b/internal/processing/media/create.go
index 357278e64..d1840196a 100644
--- a/internal/processing/media/create.go
+++ b/internal/processing/media/create.go
@@ -44,13 +44,13 @@ func (p *processor) Create(ctx context.Context, account *gtsmodel.Account, form
return nil, errors.New("could not read provided attachment: size 0 bytes")
}
- // process the media and load it immediately
- media, err := p.mediaManager.ProcessMedia(ctx, buf.Bytes(), account.ID)
+ // process the media attachment and load it immediately
+ media, err := p.mediaManager.ProcessMedia(ctx, buf.Bytes(), account.ID, "")
if err != nil {
return nil, err
}
- attachment, err := media.Load(ctx)
+ attachment, err := media.LoadAttachment(ctx)
if err != nil {
return nil, err
}
@@ -62,10 +62,5 @@ func (p *processor) Create(ctx context.Context, account *gtsmodel.Account, form
return nil, fmt.Errorf("error parsing media attachment to frontend type: %s", err)
}
- // now we can confidently put the attachment in the database
- if err := p.db.Put(ctx, attachment); err != nil {
- return nil, fmt.Errorf("error storing media attachment in db: %s", err)
- }
-
return &apiAttachment, nil
}