fix a minor bug that the song title is not set after pause

This commit is contained in:
tramhao 2021-03-02 12:27:23 +08:00
parent c954c13e16
commit ffeef53510

View File

@ -470,10 +470,15 @@ func start(application *tview.Application, args Args) {
init := false
gomu.app.SetAfterDrawFunc(func(_ tcell.Screen) {
if !init && !gomu.player.IsRunning() {
if !init {
gomu.playingBar.setDefault()
init = true
}
if gomu.player.IsRunning() {
gomu.playingBar.setSongTitle(gomu.player.GetCurrentSong().Name())
} else {
gomu.playingBar.setDefault()
}
})
go populateAudioLength(gomu.playlist.GetRoot())