From 9a8bc6c936e770c947ba59e69b01983e79a1d4fe Mon Sep 17 00:00:00 2001 From: Inevitabby <161525738+Inevitabby@users.noreply.github.com> Date: Fri, 19 Jun 2026 08:05:34 -0700 Subject: [PATCH] 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 --- ui/browsing/nowplayingpage.go | 19 +++++++++++++++++++ ui/util/thumbnailloader.go | 1 + 2 files changed, 20 insertions(+) diff --git a/ui/browsing/nowplayingpage.go b/ui/browsing/nowplayingpage.go index cebe339..16510d4 100644 --- a/ui/browsing/nowplayingpage.go +++ b/ui/browsing/nowplayingpage.go @@ -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 } diff --git a/ui/util/thumbnailloader.go b/ui/util/thumbnailloader.go index 38e3d12..69b0c9b 100644 --- a/ui/util/thumbnailloader.go +++ b/ui/util/thumbnailloader.go @@ -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) }