summaryrefslogtreecommitdiff
path: root/internal/processing/media/getfile.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-01-16 16:19:17 +0100
committerLibravatar GitHub <noreply@github.com>2023-01-16 16:19:17 +0100
commitd4cddf460a5145965b398e167f3cea24b5e3e436 (patch)
tree913fb17d42b2585e0420d5d3578cd5dc0b302eec /internal/processing/media/getfile.go
parent[chore]: Bump github.com/minio/minio-go/v7 from 7.0.44 to 7.0.47 (#1348) (diff)
downloadgotosocial-d4cddf460a5145965b398e167f3cea24b5e3e436.tar.xz
[bugfix] Parse video metadata more accurately; allow Range in fileserver (#1342)
* don't serve unused fields for video attachments * parse video bitrate + duration more accurately * use ServeContent where appropriate to respect Range * abstract temp file seeker into its own function
Diffstat (limited to 'internal/processing/media/getfile.go')
-rw-r--r--internal/processing/media/getfile.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/internal/processing/media/getfile.go b/internal/processing/media/getfile.go
index d5f74926a..48e907244 100644
--- a/internal/processing/media/getfile.go
+++ b/internal/processing/media/getfile.go
@@ -85,9 +85,6 @@ func (p *processor) GetFile(ctx context.Context, requestingAccount *gtsmodel.Acc
}
func (p *processor) getAttachmentContent(ctx context.Context, requestingAccount *gtsmodel.Account, wantedMediaID string, owningAccountID string, mediaSize media.Size) (*apimodel.Content, gtserror.WithCode) {
- attachmentContent := &apimodel.Content{}
- var storagePath string
-
// retrieve attachment from the database and do basic checks on it
a, err := p.db.GetAttachmentByID(ctx, wantedMediaID)
if err != nil {
@@ -146,6 +143,13 @@ func (p *processor) getAttachmentContent(ctx context.Context, requestingAccount
}
}
+ var (
+ storagePath string
+ attachmentContent = &apimodel.Content{
+ ContentUpdated: a.UpdatedAt,
+ }
+ )
+
// get file information from the attachment depending on the requested media size
switch mediaSize {
case media.SizeOriginal: