feat(server/m7-379): heal existing artist+album mbid on rescan
This commit is contained in:
@@ -74,3 +74,12 @@ WHERE a.id = $1
|
||||
AND NOT EXISTS (SELECT 1 FROM albums al WHERE al.artist_id = a.id)
|
||||
AND NOT EXISTS (SELECT 1 FROM tracks t WHERE t.artist_id = a.id)
|
||||
RETURNING a.id;
|
||||
|
||||
-- name: SetArtistMbidIfNull :exec
|
||||
-- M7 #379: heal MBID on existing artist rows during rescan. Idempotent —
|
||||
-- only updates when the existing mbid is NULL, so concurrent scans don't
|
||||
-- overwrite an existing value with a stale one.
|
||||
UPDATE artists
|
||||
SET mbid = $2,
|
||||
updated_at = now()
|
||||
WHERE id = $1 AND mbid IS NULL;
|
||||
|
||||
Reference in New Issue
Block a user