Skip to content

Commit

Permalink
Fix bug in file list selection
Browse files Browse the repository at this point in the history
It wasn't synced with the current playing song
  • Loading branch information
braheezy committed Jul 30, 2024
1 parent 2b8000d commit 3d09b34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func initialModel(filenames []string) *model {
m := &model{
filenames: filenames,
fileList: listModel,
currentIndex: 0,
currentIndex: -1,
ctx: ctx,
help: help,
keys: helpKeys,
Expand Down Expand Up @@ -339,8 +339,8 @@ func (m *model) loadSong(index int) {
// Create a new QOA player for the next song
m.qoaPlayer = newQOAPlayer(nextFile, m.ctx)
m.qoaPlayer.player.Play()
m.fileList.Select(m.currentIndex)
m.currentIndex = index
m.fileList.Select(m.currentIndex)
}

// nextSong changes to the next song in the filenames list, wrapping around to 0 if needed.
Expand Down

0 comments on commit 3d09b34

Please sign in to comment.