mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-13 13:38:16 +08:00
finish config_basic.go
This commit is contained in:
@@ -58,7 +58,14 @@ func (p *Playlist) Pop() *Media {
|
||||
return nil
|
||||
}
|
||||
p.Lock.Lock()
|
||||
media := p.Playlist[0]
|
||||
index := 0
|
||||
if p.Config.RandomNext {
|
||||
index = rand.Intn(p.Size())
|
||||
}
|
||||
media := p.Playlist[index]
|
||||
for i := index; i > 0; i-- {
|
||||
p.Playlist[i] = p.Playlist[i-1]
|
||||
}
|
||||
p.Playlist = p.Playlist[1:]
|
||||
p.Lock.Unlock()
|
||||
defer p.Handler.CallA(EventPlaylistUpdate, PlaylistUpdateEvent{Playlist: p})
|
||||
|
||||
Reference in New Issue
Block a user