diff --git a/room/movies.go b/room/movies.go index 19884f5..3da827f 100644 --- a/room/movies.go +++ b/room/movies.go @@ -40,13 +40,13 @@ type Movie struct { } type BaseMovie struct { - Url string `json:"url"` - Name string `json:"name"` - Live bool `json:"live"` - Proxy bool `json:"proxy"` - RtmpSource bool `json:"rtmpSource"` - Type string `json:"type"` - Headers map[string][]string `json:"headers"` + Url string `json:"url"` + Name string `json:"name"` + Live bool `json:"live"` + Proxy bool `json:"proxy"` + RtmpSource bool `json:"rtmpSource"` + Type string `json:"type"` + 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, @@ -151,18 +151,18 @@ func (m *movies) range_(f func(e *dllist.Element[*Movie]) bool) (interrupt bool) } type MovieInfo struct { - Id uint64 `json:"id"` - Url string `json:"url"` - Name string `json:"name"` - Live bool `json:"live"` - Proxy bool `json:"proxy"` - RtmpSource bool `json:"rtmpSource"` - Type string `json:"type"` - Headers map[string][]string `json:"headers"` - PullKey string `json:"pullKey"` - CreateAt int64 `json:"createAt"` - LastEditAt int64 `json:"lastEditAt"` - Creator string `json:"creator"` + Id uint64 `json:"id"` + Url string `json:"url"` + Name string `json:"name"` + Live bool `json:"live"` + Proxy bool `json:"proxy"` + RtmpSource bool `json:"rtmpSource"` + Type string `json:"type"` + Headers map[string]string `json:"headers"` + PullKey string `json:"pullKey"` + CreateAt int64 `json:"createAt"` + LastEditAt int64 `json:"lastEditAt"` + Creator string `json:"creator"` } func (m *movies) MovieList() (movies []MovieInfo) { diff --git a/room/user.go b/room/user.go index 044dcda..7afe3e8 100644 --- a/room/user.go +++ b/room/user.go @@ -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, diff --git a/server/handlers/api-movie.go b/server/handlers/api-movie.go index aebbb86..258f154 100644 --- a/server/handlers/api-movie.go +++ b/server/handlers/api-movie.go @@ -281,11 +281,11 @@ func NewPublishKey(ctx *gin.Context) { } type EditMovieReq struct { - Id uint64 `json:"id"` - Url string `json:"url"` - Name string `json:"name"` - Type string `json:"type"` - Headers map[string][]string `json:"headers"` + Id uint64 `json:"id"` + Url string `json:"url"` + Name string `json:"name"` + Type string `json:"type"` + 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) } }