Enhancement
How the nightly run works out what each album is, gathers what MusicBrainz, Discogs, AcoustID, and LRCLIB know about it, and turns the differences into careful, labeled proposals.
Files arrive with whatever tags a ripper or a tagger gave them. Enhancement (the pipeline's own word for it is enrichment) is the part of the pipeline that asks a bigger question: what does the rest of the world know about this album, and how does that compare with what we have? It is Stage B of The Pipeline, twelve steps in all, and it is where an album stops being a folder of files and becomes a documented release.
Two ideas run through all twelve steps. The first is identity before everything: you cannot compare an album with a reference until you know which release it is. The second is proposals, not edits: no enhancement step ever touches an audio file. Each one records what it learned in the album's notebook, and the writeback stage applies the safe changes later.
Step one is knowing who you are
An album's identity is a MusicBrainz release ID. It can arrive in only three ways, in this order of trust:
- An ID embedded in the files, put there by Picard.
- A barcode lookup.
- Audio-fingerprint agreement through AcoustID, where enough of the album's tracks point at the same release.
Searching by title is never allowed, because a title can match the wrong release. The order matters for what happens next: an ID from the first two ways is canonical, and an ID from fingerprints alone is provisional, and the confidence of the MusicBrainz proposals depends on it.
B10b, fingerprint. Computes an audio fingerprint of each track with a local tool. No network is involved; the lookup comes next. The point is to identify a recording by how it sounds when the tags are wrong or missing.
B11b, fingerprint match. Sends the stored fingerprints to the AcoustID service. If enough tracks agree on one release, the album gets a provisional ID, staged as proposed. If the album already has an ID, the step re-confirms it, and a matching consensus upgrades the ID's confidence. Albums with no commercial release behind them are skipped.
B20b, MusicBrainz capture. Settles which release the album is and downloads the full release record. When the files disagree about their release, it votes, and if that is still ambiguous it compares candidate releases' track lists and picks the one containing the most of the album's recordings. It fetches once and stores everything in the notebook, so every later comparison happens offline and deterministically. It re-fetches only when something makes the stored copy untrustworthy, such as age, a changed ID, or an upgraded capture format, and it stops the whole queue at the first sign of a rate limit, requeueing the rest, which is how the pipeline keeps its manners with a free public service.
B23b, Discogs capture. Looks the album up on Discogs, by barcode only; there is no text search. If several results come back, it scores them: a matching catalog number counts for the most, then a matching country, then community popularity as a tiebreaker. Exactly one result is confirmed; several is a proposed heuristic pick held for review. Discogs often has pressing, label, catalog-number, and credit details that MusicBrainz lacks, and a barcode is a nearly unique key.
B26b, tracklist. Lines the files up against the official tracklist and records which official recording each file is. A file gets a recording ID only when the stored release proves it: either the file's own embedded recording ID belongs to the release, or its disc and position match a release track and its title names the same song. Otherwise the file stays unmapped, because a wrong ID would make another song count as owned. Later steps need this for completeness counts and lyric lookups.
Turning differences into proposals
B30b, MusicBrainz enhancement. Compares the album's tags with the stored MusicBrainz release and stages the differences as proposed actions. It works offline. Confidence follows identity: when the ID is canonical, MusicBrainz is treated as the truth and differences are staged planned; when the ID came from fingerprints alone, filling an empty tag is still planned, but changing an existing value is only proposed. By default, partial albums get no track-level proposals at all, since a missing track makes the pairing unreliable. That is Mike's call, and a setting. It also normalizes the album's sort name, moving a leading "The," "A," or "An" to the end ("White Album, The") so the album files where a person would look. It never proposes a genre, and for Christmas albums it strips any existing genre action so the genre step starts clean.
B40b, Discogs enhancement. The same job against the Discogs record. It covers style, country, label, catalog number, year, barcode, and credits, including producer, engineer, mixer, composer, lyricist, and arranger. Several gates stand between a Discogs value and the files:
- A title-trust gate. Nothing is staged unless the Discogs release agrees with the MusicBrainz or folder title, or enough track titles match, because barcodes get reused across different titles.
- A confidence rule.
plannedwhen Discogs returned exactly one barcode result,proposedwhen it picked among several. Filling an empty tag is alwaysplanned. - An automatic triage tier, behind a switch, that can promote safe conflicts to
plannedor decline clear losses asrejected. Ambiguous ones stayproposedfor review. - A no-regression filter. Suppresses proposals that are not improvements: a reordering, a subset, a less precise date, or a value with a character-encoding corruption signature.
Genre is deliberately never proposed by either step.
Two guardrails worth explaining
The first is the no-regression rule, a principle for the whole system: enrichment must never lose information. A proposal that makes a date less precise, a country less specific, or a credit shorter than the one already in the tag is suppressed or declined. A new value earns its place by adding something, not by replacing something with less.
The second guards against a trap that has bitten before. A Discogs value with accented characters may have been corrupted by a text-encoding mix-up somewhere upstream. B23b re-fetches releases captured before a certain date whose text shows that corruption signature, and B40b refuses to propose them. Approving such a value would have damaged a perfectly good name.
Measurements and extras
B50b, ReplayGain. Measures each album's loudness with a local tool and stages the ReplayGain 2.0 values, album and per-track gain and peak, as planned. B50b never writes tags itself. It skips albums that already have staged values unless the files changed since, because a changed audio file makes the old numbers stale.
B60b, lyrics. Looks up lyrics for each recording on LRCLIB, using the canonical artist, title, album, and duration from MusicBrainz, which match better than raw file tags do. A "not found" answer is stored as a valid result, and instrumentals are recorded as such, so the step does not keep asking. Cooldowns space out the re-checks, and the lyrics land in the notebook only, with no change to the audio tags. A separate inventory report tracks coverage across the library.
Cover art
Three Stage B steps deal in images: B31b fetches from the Cover Art Archive, B41b from Discogs, and B70b settles the easy cases. They are the opening of the story on the Artwork page.
Being a good neighbor
MusicBrainz, Discogs, AcoustID, and LRCLIB are free or shared services, and the pipeline treats them that way:
- It makes one pass per album per capture and stores the result, then reads it offline.
- Calls are throttled, and each step stops the queue at the first confirmed rate-limit response instead of hammering.
- Stored captures carry a freshness date, so an old one, or one whose album ID or barcode has changed, is the reason to fetch again, and not much else.
Next: Artwork, where the images come in.