Skip to content

Commit

Permalink
fix: movie subpath
Browse files Browse the repository at this point in the history
  • Loading branch information
zijiren233 committed Feb 12, 2025
1 parent 68fd1d9 commit b4740d5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions internal/op/current.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ func (c *current) Current() model.Current {
return c.current
}

func (c *current) SubPath() string {
func (c *current) CurrentMovie() model.CurrentMovie {
c.lock.RLock()
defer c.lock.RUnlock()
return c.current.Movie.SubPath
return c.current.Movie
}

func (c *current) SetMovie(movie model.CurrentMovie, play bool) {
Expand Down
2 changes: 1 addition & 1 deletion internal/op/movie.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type Movie struct {
}

func (m *Movie) SubPath() string {
return m.room.CurrentSubPath()
return m.room.SubPath(m.ID)
}

func (m *Movie) ExpireID(ctx context.Context) (uint64, error) {
Expand Down
12 changes: 6 additions & 6 deletions internal/op/room.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,12 @@ func (r *Room) SetCurrentMovie(movieID string, subPath string, play bool) error
return m.ClearCache()
}

func (r *Room) CurrentSubPath() string {
fmt.Println("CurrentSubPath", r.current)
fmt.Println("CurrentSubPath", r.current)
fmt.Println("CurrentSubPath", r.current)
fmt.Println("CurrentSubPath", r.current)
return r.current.SubPath()
func (r *Room) SubPath(id string) string {
m := r.current.CurrentMovie()
if m.ID == id {
return m.SubPath
}
return ""
}

func (r *Room) SwapMoviePositions(id1, id2 string) error {
Expand Down

0 comments on commit b4740d5

Please sign in to comment.