fix deleting unhiglighted song in queue

This commit is contained in:
raziman 2020-06-22 21:17:44 +08:00
parent 0dd9d3ced4
commit 2496631e33
2 changed files with 6 additions and 3 deletions

View File

@ -36,8 +36,11 @@ func Queue(player *Player) *tview.List {
prev()
case 'd':
index := list.GetCurrentItem()
player.Remove(index)
list.RemoveItem(index)
if index != -1 {
player.Remove(index)
list.RemoveItem(index)
}
}

View File

@ -21,7 +21,7 @@ func start(app *tview.Application) {
player := &Player{}
child3 := PlayingBar(app)
child3 := PlayingBar(app, player)
child2 := Queue(player)
child1 := Playlist(child2, child3, player)