Fix: movies dont use pb

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

@ -186,14 +186,15 @@ 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(),
BaseMovieInfo: BaseMovieInfo{
Url: e.Value.Url, Url: e.Value.Url,
Name: e.Value.Name, Name: e.Value.Name,
Live: e.Value.Live, Live: e.Value.Live,
@ -201,6 +202,7 @@ func (u *User) Movies() []*pb.MovieInfo {
RtmpSource: e.Value.RtmpSource, RtmpSource: e.Value.RtmpSource,
Type: e.Value.Type, Type: e.Value.Type,
Headers: e.Value.Headers, Headers: e.Value.Headers,
},
PullKey: e.Value.PullKey, PullKey: e.Value.PullKey,
CreatedAt: e.Value.CreatedAt, CreatedAt: e.Value.CreatedAt,
Creator: e.Value.Creator().Name(), Creator: e.Value.Creator().Name(),

Loading…
Cancel
Save