Fix: movies dont use pb

pull/21/head
zijiren233 2 years ago
parent bf1334d1b3
commit bb1b94fc1e

@ -186,24 +186,26 @@ func (u *User) Movie(id uint64) (*pb.MovieInfo, error) {
return movie, nil return movie, nil
} }
func (u *User) Movies() []*pb.MovieInfo { func (u *User) Movies() []*MovieInfo {
u.room.movies.lock.RLock() u.room.movies.lock.RLock()
defer u.room.movies.lock.RUnlock() defer u.room.movies.lock.RUnlock()
movies := make([]*pb.MovieInfo, 0, u.room.movies.l.Len()) movies := make([]*MovieInfo, 0, u.room.movies.l.Len())
u.room.movies.range_(func(e *dllist.Element[*Movie]) bool { u.room.movies.range_(func(e *dllist.Element[*Movie]) bool {
m := &pb.MovieInfo{ m := &MovieInfo{
Id: e.Value.Id(), Id: e.Value.Id(),
Url: e.Value.Url, BaseMovieInfo: BaseMovieInfo{
Name: e.Value.Name, Url: e.Value.Url,
Live: e.Value.Live, Name: e.Value.Name,
Proxy: e.Value.Proxy, Live: e.Value.Live,
RtmpSource: e.Value.RtmpSource, Proxy: e.Value.Proxy,
Type: e.Value.Type, RtmpSource: e.Value.RtmpSource,
Headers: e.Value.Headers, Type: e.Value.Type,
PullKey: e.Value.PullKey, Headers: e.Value.Headers,
CreatedAt: e.Value.CreatedAt, },
Creator: e.Value.Creator().Name(), PullKey: e.Value.PullKey,
CreatedAt: e.Value.CreatedAt,
Creator: e.Value.Creator().Name(),
} }
if e.Value.Proxy && u.name != m.Creator { if e.Value.Proxy && u.name != m.Creator {
m.Headers = nil m.Headers = nil

Loading…
Cancel
Save