From d4cddf460a5145965b398e167f3cea24b5e3e436 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 16 Jan 2023 16:19:17 +0100 Subject: [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 --- internal/processing/media/getfile.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'internal/processing') 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: -- cgit v1.2.3