feat(server/m7-379): heal existing artist+album mbid on rescan
This commit is contained in:
@@ -96,3 +96,11 @@ DELETE FROM albums a
|
||||
WHERE a.id = $1
|
||||
AND NOT EXISTS (SELECT 1 FROM tracks t WHERE t.album_id = a.id)
|
||||
RETURNING a.id, a.artist_id;
|
||||
|
||||
-- name: SetAlbumMbidIfNull :exec
|
||||
-- M7 #379: heal MBID on existing album rows during rescan. Idempotent —
|
||||
-- only updates when the existing mbid is NULL.
|
||||
UPDATE albums
|
||||
SET mbid = $2,
|
||||
updated_at = now()
|
||||
WHERE id = $1 AND mbid IS NULL;
|
||||
|
||||
Reference in New Issue
Block a user