minor fix: panic when rename sone and not playing

This commit is contained in:
tramhao 2021-04-02 17:21:39 +08:00
parent 6976541a2a
commit 8db110282a

View File

@ -867,10 +867,11 @@ func (p *Playlist) refreshByNode(node *AudioFile, newName string) error {
return tracerr.Wrap(err)
}
currentSong := gomu.player.GetCurrentSong()
if currentSong == nil {
if !gomu.player.IsRunning() {
return nil
}
currentSong := gomu.player.GetCurrentSong()
if node.name == currentSong.Name() {
gomu.queue.enqueue(newNode)
gomu.queue.pushFront(newNode)