From fde8a7cd74a42cf820c7fefda41aedc58fa84054 Mon Sep 17 00:00:00 2001 From: Deluan Date: Tue, 1 Sep 2026 19:17:03 -0400 Subject: [PATCH] fix(artwork): name failed among the sources a typo error suggests The suggestion list is built from the sources actually in use, and failed is never stored as one, so rejecting `--source faild` listed every valid value except the one this PR added. Found by typo'ing it against a running server while checking the rest of the command. --- cmd/artwork.go | 3 ++- cmd/artwork_test.go | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd/artwork.go b/cmd/artwork.go index 6d12037ca..9a64cd8c3 100644 --- a/cmd/artwork.go +++ b/cmd/artwork.go @@ -464,7 +464,8 @@ func validateSources(q model.ArtworkQueueRepository, sources []string) error { if len(unknown) == 0 { return nil } - valid := slice.Map(inUse, displaySource) + // failed is accepted but never stored, so listing only what is in use would hide it. + valid := append(slice.Map(inUse, displaySource), failedSource) slices.Sort(valid) return fmt.Errorf("no artwork resolves from %s; sources in use: %s", strings.Join(unknown, ", "), cmp.Or(strings.Join(valid, ", "), "(none)")) diff --git a/cmd/artwork_test.go b/cmd/artwork_test.go index f2ac45442..71b450914 100644 --- a/cmd/artwork_test.go +++ b/cmd/artwork_test.go @@ -783,6 +783,14 @@ var _ = Describe("reprocessArtwork", func() { imageAgents, true, accept, &out)).ToNot(Succeed(), "a typo must still be rejected") }) + It("names failed among the valid sources when rejecting a typo", func() { + err := reprocessArtwork(ctx, ds, kinds, []string{"faild"}, imageAgents, true, accept, &out) + + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring("failed"), + "failed is accepted but never stored, so it has to be named explicitly") + }) + It("accepts a source another kind uses, letting the empty selection report itself", func() { Expect(reprocessArtwork(ctx, ds, []model.Kind{model.KindArtistArtwork}, []string{"folder"}, imageAgents, false, decline, &out)).To(Succeed())