fix: clear stale cover art and backgrounds on tracks without art (#957)

* fix: ensure load callback fires on error

Calls callOnLoaded(nil) when image loading fails.

This fixes the bottomplayer silently retaining stale images by ensuring consumers always get a callback and can clear their display state.

* fix: clear background layers on missing art

nil state now hides the blurred background widgets or animates the gradient to transparent, depending on the active configuration
This commit is contained in:
Inevitabby
2026-06-19 08:05:34 -07:00
committed by GitHub
parent 2ffbbba3db
commit 9a8bc6c936
2 changed files with 20 additions and 0 deletions
+19
View File
@@ -330,6 +330,25 @@ func (a *NowPlayingPage) onImageLoaded(img image.Image, err error) {
fyne.Do(func() { a.card.SetCoverImage(img) })
if img == nil {
if a.conf.UseBackgroundImage {
fyne.Do(func() {
if !a.backgroundImgA.Hidden {
a.backgroundImgA.Hide()
}
if !a.backgroundImgB.Hidden {
a.backgroundImgB.Hide()
}
})
} else {
if a.backgroundGradient.StartColor != color.Transparent {
anim := canvas.NewColorRGBAAnimation(
a.backgroundGradient.StartColor, color.Transparent, myTheme.AnimationDurationMedium, func(c color.Color) {
a.backgroundGradient.StartColor = c
a.backgroundGradient.Refresh()
})
anim.Start()
}
}
return
}
+1
View File
@@ -52,6 +52,7 @@ func (i *ThumbnailLoader) Load(coverID string) {
fyne.Do(func() {
if err != nil {
log.Printf("Error loading cover image: %s", err.Error())
i.callOnLoaded(nil)
} else {
i.callOnLoaded(img)
}