Fix: movie header use string string record

pull/21/head
zijiren233 2 years ago
parent ab7dfa5bc8
commit a3a0fff3df

@ -46,7 +46,7 @@ type BaseMovie struct {
Proxy bool `json:"proxy"`
RtmpSource bool `json:"rtmpSource"`
Type string `json:"type"`
Headers map[string][]string `json:"headers"`
Headers map[string]string `json:"headers"`
}
type MovieConf func(m *Movie)
@ -69,7 +69,7 @@ func WithCreator(creator *User) MovieConf {
}
}
func NewMovie(id uint64, url, name, type_ string, live, proxy, rtmpSource bool, headers map[string][]string, conf ...MovieConf) (*Movie, error) {
func NewMovie(id uint64, url, name, type_ string, live, proxy, rtmpSource bool, headers map[string]string, conf ...MovieConf) (*Movie, error) {
return NewMovieWithBaseMovie(id, BaseMovie{
Url: url,
Name: name,
@ -158,7 +158,7 @@ type MovieInfo struct {
Proxy bool `json:"proxy"`
RtmpSource bool `json:"rtmpSource"`
Type string `json:"type"`
Headers map[string][]string `json:"headers"`
Headers map[string]string `json:"headers"`
PullKey string `json:"pullKey"`
CreateAt int64 `json:"createAt"`
LastEditAt int64 `json:"lastEditAt"`

@ -142,7 +142,7 @@ func (u *User) SetAdmin(admin bool) {
u.admin = admin
}
func (u *User) NewMovie(url string, name string, type_ string, live bool, proxy bool, rtmpSource bool, headers map[string][]string, conf ...MovieConf) (*Movie, error) {
func (u *User) NewMovie(url string, name string, type_ string, live bool, proxy bool, rtmpSource bool, headers map[string]string, conf ...MovieConf) (*Movie, error) {
return u.NewMovieWithBaseMovie(BaseMovie{
Url: url,
Name: name,

@ -285,7 +285,7 @@ type EditMovieReq struct {
Url string `json:"url"`
Name string `json:"name"`
Type string `json:"type"`
Headers map[string][]string `json:"headers"`
Headers map[string]string `json:"headers"`
}
func EditMovie(ctx *gin.Context) {
@ -519,7 +519,7 @@ func ProxyMovie(ctx *gin.Context) {
if cm.Headers != nil {
for k, v := range cm.Headers {
req.SetHeader(k, v[0])
req.SetHeader(k, v)
}
}

Loading…
Cancel
Save