[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
This commit is contained in:
tobi
2023-01-16 16:19:17 +01:00
committed by GitHub
parent fe3e9ede52
commit d4cddf460a
14 changed files with 216 additions and 92 deletions

View File

@@ -21,6 +21,7 @@ package model
import (
"io"
"net/url"
"time"
)
// Content wraps everything needed to serve a blob of content (some kind of media) through the API.
@@ -29,6 +30,8 @@ type Content struct {
ContentType string
// ContentLength in bytes
ContentLength int64
// Time when the content was last updated.
ContentUpdated time.Time
// Actual content
Content io.ReadCloser
// Resource URL to forward to if the file can be fetched from the storage directly (e.g signed S3 URL)