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/api/model/attachment.go | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'internal/api/model/attachment.go') 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. -- cgit v1.2.3