Re-acquisition targets albums with ANY track missing, and completion only
asked for a track on disk, so the tracks that never left completed every
re-acquisition request the moment Lidarr accepted the add (52 on the deploy,
each ~150ms after its add).
An album or track request now completes when an album named by its release
or group has a track on disk AND either a track arrived after the request
(a new album, or Lidarr fetching another release into its own row) or no
track that was missing at the request is still missing. added_at is the
arrival clock; updated_at moves on every tag re-read.
Migration 0071 reopens completed album/track requests whose matched album
fails that test, as approved with the match cleared; the Lidarr add stays
confirmed, so nothing is re-sent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lidarr's metadata is keyed by MusicBrainz release group, but re-acquisition
requested albums by their release id, so every add came back "not found".
- Sweeper requests an album by its tag-supplied release group, else the one
MusicBrainz names (cached onto the album). An album MusicBrainz cannot name
is skipped and counted, with no attempt spent.
- Reconciler: an add refused as not found re-reads the request's album id as
a release (library first, then MusicBrainz), rewrites the request to the
group and adds again. This repairs the requests already stored.
- Completion matches an album by release id or release group, and only once a
track of it is on disk, so a re-acquisition request no longer completes
against the row of the album it is trying to bring back.
Closes#5241.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>