mirror of
https://github.com/navidrome/navidrome.git
synced 2026-08-01 07:21:17 +00:00
fix(artwork): broadcast refresh for stale-found artwork too
This commit is contained in:
parent
05ba549843
commit
3a9dadfe34
@ -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()
|
||||
|
||||
@ -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() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user