mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-04-25 13:48:49 +08:00
Minor Fix: clear album photo if no photo embeded
This commit is contained in:
parent
29894636cc
commit
5b5c6be651
@ -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")
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user