From 3a9dadfe347d408c7784fc11ec8150cf4122a402 Mon Sep 17 00:00:00 2001 From: Deluan Date: Wed, 22 Jul 2026 20:57:08 -0400 Subject: [PATCH] fix(artwork): broadcast refresh for stale-found artwork too --- core/artwork/worker.go | 3 ++- core/artwork/worker_test.go | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/artwork/worker.go b/core/artwork/worker.go index 3261f35a7..a71495441 100644 --- a/core/artwork/worker.go +++ b/core/artwork/worker.go @@ -143,7 +143,8 @@ func (w *Worker) drain(ctx context.Context, concurrency int) (int, error) { defer wg.Done() defer func() { <-sem }() defer w.release(it) - if w.process(ctx, it) == outcomeFound { + // foundStale also wrote a served state row, so it must refresh the UI too. + if out := w.process(ctx, it); out == outcomeFound || out == outcomeFoundStale { foundMu.Lock() found = append(found, it) foundMu.Unlock() diff --git a/core/artwork/worker_test.go b/core/artwork/worker_test.go index 86a9d37a2..97bbc41c8 100644 --- a/core/artwork/worker_test.go +++ b/core/artwork/worker_test.go @@ -222,6 +222,10 @@ var _ = Describe("Worker", func() { ia, err := artRepo.GetItemArtwork("al", "alstale", model.ImageTypePrimary) Expect(err).ToNot(HaveOccurred()) Expect(ia.Source).To(Equal("folder"), "the fallback art is served meanwhile") + + evts := broker.getEvents() + Expect(evts).To(HaveLen(1), "the served fallback art must live-refresh the UI") + Expect(evts[0].(*events.RefreshResource).Data(evts[0])).To(ContainSubstring("alstale")) }) It("keeps a row re-enqueued between dequeue and delete", func() {