navidrome/db/migrations/20260901225726_normalize_artwork_last_failure.sql
Deluan Quintão 47bc3c00f3
fix(artwork): never retry absent artwork on its own (#6054)
An absent artwork state was revisited by an hourly job, by viewing the entity, and
by the startup backfill on any artwork config change. On a large library the last
one queued tens of thousands of external lookups at once and got the provider to
rate-limit us for hours.

Nothing revisits an absent state now. Retrying is explicit: `artwork reprocess` on
the CLI, or the refresh button in the UI. The config fingerprint survives only as an
advisory, warning at startup and naming the command that clears it.

Since absent is terminal, `artwork status` splits it into two disjoint columns, and
`--source failed` targets only the ones that gave up rather than being answered.
Both read through the filter CountBySource and EnqueueBySource already share, so the
reported number is the set the command acts on.

Also fixes the last_failure default left by 20260819204637, which marked every
pre-existing absent row as failed, and removes the code the deleted retry paths
orphaned.
2026-09-01 20:48:41 -04:00

10 lines
456 B
SQL

-- +goose Up
-- 20260819204637 added last_failure with DEFAULT '[]', so every row already in the table got a
-- non-empty value. That is how a give-up is now told apart from a definitive "no image", which
-- would report every pre-existing absent row as failed.
UPDATE item_artwork SET last_failure = '' WHERE last_failure = '[]';
-- +goose Down
-- Irreversible: a genuine give-up and a backfilled default are indistinguishable once normalized.
SELECT 1;