summaryrefslogtreecommitdiff
path: root/internal/api/model/attachment.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/api/model/attachment.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/api/model/attachment.go')
-rw-r--r--internal/api/model/attachment.go30
1 files changed, 1 insertions, 29 deletions
diff --git a/internal/api/model/attachment.go b/internal/api/model/attachment.go
index 244f3cd8d..79de44540 100644
--- a/internal/api/model/attachment.go
+++ b/internal/api/model/attachment.go
@@ -98,40 +98,12 @@ type Attachment struct {
//
// swagger:model mediaMeta
type MediaMeta struct {
- Length string `json:"length,omitempty"`
- // Duration of the media in seconds.
- // Only set for video and audio.
- // example: 5.43
- Duration float32 `json:"duration,omitempty"`
- // Framerate of the media.
- // Only set for video and gifs.
- // example: 30
- FPS uint16 `json:"fps,omitempty"`
- // Size of the media, in the format `[width]x[height]`.
- // Not set for audio.
- // example: 1920x1080
- Size string `json:"size,omitempty"`
- // Width of the media in pixels.
- // Not set for audio.
- // example: 1920
- Width int `json:"width,omitempty"`
- // Height of the media in pixels.
- // Not set for audio.
- // example: 1080
- Height int `json:"height,omitempty"`
- // Aspect ratio of the media.
- // Equal to width / height.
- // example: 1.777777778
- Aspect float32 `json:"aspect,omitempty"`
- AudioEncode string `json:"audio_encode,omitempty"`
- AudioBitrate string `json:"audio_bitrate,omitempty"`
- AudioChannels string `json:"audio_channels,omitempty"`
// Dimensions of the original media.
Original MediaDimensions `json:"original"`
// Dimensions of the thumbnail/small version of the media.
Small MediaDimensions `json:"small,omitempty"`
// Focus data for the media.
- Focus MediaFocus `json:"focus,omitempty"`
+ Focus *MediaFocus `json:"focus,omitempty"`
}
// MediaFocus models the focal point of a piece of media.