2 fixes:1. song title is empty after pause(if pause within 2-3 seconds 2. lyric default set to english

This commit is contained in:
tramhao 2021-02-23 16:50:20 +08:00
parent 7349bad749
commit 69bfb5ee7c
2 changed files with 5 additions and 2 deletions

View File

@ -207,6 +207,7 @@ func (p *Player) play() {
p.ctrl.Paused = false
p.isRunning = true
speaker.Unlock()
gomu.playingBar.setSongTitle(p.currentSong.name)
}
// volume up and volume down using -0.5 or +0.5

View File

@ -86,7 +86,7 @@ func (p *PlayingBar) run() error {
// our progress bar
if p.hasTag && p.subtitles != nil {
for i := range p.subtitles {
if p.subtitles[i].langExt == p.langLyric {
if strings.Contains(p.langLyric, p.subtitles[i].langExt) {
p.subtitle = p.subtitles[i].subtitle
break
}
@ -167,8 +167,10 @@ func (p *PlayingBar) newProgress(currentSong *AudioFile, full int) {
subtitle: &res,
}
p.subtitles = append(p.subtitles, subtitle)
p.langLyric = "en"
p.langLyric = gomu.anko.GetString("General.lang_lyric")
if p.langLyric == "" {
p.langLyric = "en"
}
}
}
defer tag.Close()