From 21751221fc4b727417b964c633babcc470c3cdfc Mon Sep 17 00:00:00 2001 From: Michael Manganiello Date: Sat, 24 Feb 2024 15:04:03 -0300 Subject: [PATCH] fix: MPRIS broken cover art on Linux Problem: When changing tracks, the toolbar display on Linux sometimes misses the track cover art, and displays a placeholder instead. Solution: Copy same callback as the one used for MacOS, which calls `GetCoverArtUrl` first, to avoid missing cover arts. --- backend/app.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/app.go b/backend/app.go index 0042470..caa745d 100644 --- a/backend/app.go +++ b/backend/app.go @@ -265,7 +265,10 @@ func (a *App) setupMPV() error { func (a *App) setupMPRIS(mprisAppName string) { a.MPRISHandler = NewMPRISHandler(mprisAppName, a.PlaybackManager) - a.MPRISHandler.ArtURLLookup = a.ImageManager.GetCoverArtUrl + a.MPRISHandler.ArtURLLookup = func(id string) (string, error) { + a.ImageManager.GetCoverThumbnail(id) // ensure image is cached locally + return a.ImageManager.GetCoverArtUrl(id) + } a.MPRISHandler.OnRaise = func() error { a.callOnReactivate(); return nil } a.MPRISHandler.OnQuit = func() error { if a.OnExit == nil {