feat(server/m7-380): one-shot MBID backfill worker for existing libraries
Adds a boot-time goroutine that walks albums with NULL mbid, re-reads tags from one track per album via dhowden/tag, and persists album + artist MBIDs. Healed albums also get their cover_art_source='none' cleared so the enricher's next batch retries the MBCAA fetch. Caps at 5000 albums per boot to avoid stalling startup on huge libraries. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -44,6 +44,14 @@ UPDATE albums
|
||||
cover_art_source = NULL
|
||||
WHERE id = $1;
|
||||
|
||||
-- name: ClearAlbumCoverNone :exec
|
||||
-- M7 #380: when MBID backfill heals an album, clear its 'none' cover_art_source
|
||||
-- back to NULL so the enricher's next batch retries the MBCAA fetch.
|
||||
-- Idempotent — only updates rows currently stamped 'none'.
|
||||
UPDATE albums
|
||||
SET cover_art_source = NULL
|
||||
WHERE id = $1 AND cover_art_source = 'none';
|
||||
|
||||
-- name: CountAlbumCoverSources :one
|
||||
-- Diagnostic for the admin overview: counts by source, including NULL.
|
||||
-- Returns one row with named tallies.
|
||||
|
||||
Reference in New Issue
Block a user