diff --git a/dbstruct/media.go b/dbstruct/media.go index b3486353..e49235ed 100644 --- a/dbstruct/media.go +++ b/dbstruct/media.go @@ -42,6 +42,9 @@ type ToCVideo struct { Id int64 `json:"id"` // 视频id Dur int64 `json:"dur"` // 视频时 CoverUrls []string `json:"cover_urls"` // 视频封面地址 + CoverW int64 `json:"cover_w"` // 封面宽 + CoverH int64 `json:"cover_h"` // 封面高 + CoverFmt string `json:"cover_fmt"` // 封面图片格式 Urls []string `json:"urls"` // 视频地址 } diff --git a/library/mediafiller/mediafillerhelper.go b/library/mediafiller/mediafillerhelper.go index a3d21a2c..ce657729 100644 --- a/library/mediafiller/mediafillerhelper.go +++ b/library/mediafiller/mediafillerhelper.go @@ -67,6 +67,9 @@ func transToCVideo(video *dbstruct.Video, coverImg *dbstruct.Image) *dbstruct.To Urls: []string{defaultMediaFiller.fileServerDomainName + video.SrcId}, } if coverImg != nil { + ret.CoverW = coverImg.W + ret.CoverH = coverImg.H + ret.CoverFmt = coverImg.Fmt ret.CoverUrls = []string{defaultMediaFiller.fileServerDomainName + coverImg.SrcId} } return ret