summaryrefslogtreecommitdiff
path: root/internal/processing/media/getmedia.go
diff options
context:
space:
mode:
authorLibravatar kim <grufwub@gmail.com>2025-11-03 21:16:42 +0100
committerLibravatar tobi <tobi.smethurst@protonmail.com>2025-11-17 14:12:22 +0100
commit29547ce8aba63454e84d277b0597fb2764e8cb23 (patch)
treee80d0d74eea123dbc6dd1dcffadff0cb11f82faa /internal/processing/media/getmedia.go
parent[bugfix] Fix invalid period parameter when generating the TOTP URL (#4536) (diff)
downloadgotosocial-29547ce8aba63454e84d277b0597fb2764e8cb23.tar.xz
[bugfix] more RSS validation issues (#4517)
Fixes some validation issues relating to author information often expected to be valid email addresses, which our @displayname@username is not. There's still a few more validation issues, but honestly if we're going have better support I think it might be worth dropping gorilla/feeds for our own tagged XML / JSON structs. Also does a bunch of housekeeping in the typeutils package removing error returns where never used / only ever logged, removing unused contexts etc. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4517 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/processing/media/getmedia.go')
-rw-r--r--internal/processing/media/getmedia.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/internal/processing/media/getmedia.go b/internal/processing/media/getmedia.go
index 5144bbd8e..22e05cab3 100644
--- a/internal/processing/media/getmedia.go
+++ b/internal/processing/media/getmedia.go
@@ -26,6 +26,7 @@ import (
"code.superseriousbusiness.org/gotosocial/internal/db"
"code.superseriousbusiness.org/gotosocial/internal/gtserror"
"code.superseriousbusiness.org/gotosocial/internal/gtsmodel"
+ "code.superseriousbusiness.org/gotosocial/internal/typeutils"
)
func (p *Processor) Get(ctx context.Context, account *gtsmodel.Account, mediaAttachmentID string) (*apimodel.Attachment, gtserror.WithCode) {
@@ -42,10 +43,6 @@ func (p *Processor) Get(ctx context.Context, account *gtsmodel.Account, mediaAtt
return nil, gtserror.NewErrorNotFound(errors.New("attachment not owned by requesting account"))
}
- a, err := p.converter.AttachmentToAPIAttachment(ctx, attachment)
- if err != nil {
- return nil, gtserror.NewErrorNotFound(fmt.Errorf("error converting attachment: %s", err))
- }
-
+ a := typeutils.AttachmentToAPIAttachment(attachment)
return &a, nil
}