diff --git a/lyric/lrc.go b/lyric/lrc.go index ea0c69a..4f55611 100644 --- a/lyric/lrc.go +++ b/lyric/lrc.go @@ -270,7 +270,7 @@ func timeLRC(t uint32) string { // GetText will fetch lyric by time in seconds func (lyric *Lyric) GetText(time int) (string, error) { - if lyric.SyncedCaptions == nil { + if len(lyric.SyncedCaptions) == 0 { return "", errors.New("no synced lyric found") } diff --git a/playingbar.go b/playingbar.go index 89fd3ca..a8fb15a 100644 --- a/playingbar.go +++ b/playingbar.go @@ -281,6 +281,12 @@ func (p *PlayingBar) loadLyrics(currentSongPath string) error { p.hasTag = true p.tag = tag + if p.albumPhoto != nil { + p.albumPhoto.Clear() + p.albumPhoto.Destroy() + p.albumPhoto = nil + } + syltFrames := tag.GetFrames(tag.CommonID("Synchronised lyrics/text")) usltFrames := tag.GetFrames(tag.CommonID("Unsynchronised lyrics/text transcription")) @@ -324,9 +330,6 @@ func (p *PlayingBar) loadLyrics(currentSongPath string) error { go gomu.app.QueueUpdateDraw(func() { x, y, _, _ := p.GetInnerRect() width, height, windowWidth, windowHeight := getConsoleSize() - if err != nil { - errorPopup(err) - } p.albumPhoto, err = ugo.NewImage(dstImage128, (x+3)*windowWidth/width, (y+2)*windowHeight/height) if err != nil {