Engineering articles
← All articles

Matching Spotify recordings to Discogs credits

Nvoko: finding who wrote a song across 19.4 million Discogs releases.

In short

Nvoko needs a song's writers to invite them to its agreements. On recordings it had never seen, every match my matcher marked as verified was correct.

From Nvoko · Sole engineer

Architecture

  1. Spotify catalogue import
  2. Discogs snapshot in PostgreSQL (19.4M releases)
  3. Matcher: identity pinning and tiers
  4. Credits and invitations in Nvoko

What was hard

Names don't identify recordings. Twenty other Discogs artists are called Drake. The same song appears as remasters, edits, live versions, remixes and covers, and most Discogs credits belong to a whole album, not one track. A wrong match here sends an agreement invitation to the wrong person.

How I found it

I measured before changing anything. On the 205 recordings from real catalogue imports, the matcher in production matched none, so the work started with a labelled evaluation set rather than with the algorithm.

What shipped

Each artist is pinned once to one Discogs artist ID, by how many of their Spotify titles appear in each candidate's catalogue. Drake had 76 title overlaps against 0 for each of the other 20, and a reviewer confirms the pick.

Each recording then lands in a tier. Verified means the pinned artist performs on the track, title and version agree, the duration is within 3 seconds, and a second source corroborates it: two releases, the master's main release, or an ISRC match. Only verified matches can create invitations. Weaker matches are kept as suggestions, or as composition matches that yield writers only.

Credits carry their own level. Album-wide credits are never verified, and a writer credit from another recording of the song counts only when it comes from the same Discogs master as a verified recording, so a same-titled song on another release can't lend its writers.

To keep the numbers honest, each version was tuned on one labelled set and measured on the next: 1,048 track labels across 312 recordings in three separate sets. MusicBrainz serves as a second source and an independent check on Discogs writers.

Code excerptdiscogs-catalog/match.mjs
export function decide(song, hits) {
  const want = parseTitle(song.name);
  const generic = isGenericTitle(want.base);
  const identified = hit => (hit.host || hit.viaIsrc) && !hit.ambiguous;
  const recording = hits.filter(hit =>
    identified(hit) && hit.sameVersion && hit.duration !== 'off');
  const strong = recording.filter(hit => hit.duration === 'ok' ||
    (hit.viaIsrc && hit.duration === 'missing'));
  const composition = hits.filter(hit => identified(hit) && !hit.sameVersion);
  const strongReleases = new Set(strong.map(hit => hit.release.id));
  const corroborated = strongReleases.size >= 2 ||
    strong.some(hit => hit.isMainRelease || hit.viaIsrc);
  const tier =
    strong.length && corroborated && (!generic || strong.some(hit => hit.viaIsrc)) ? 'verified'
    : recording.length && !generic ? 'suggested'
    : composition.length && !generic ? 'composition'
    : 'none';
  // ...credits are collected per tier...
}

Condensed. Verified needs a strong match and corroboration from a second source.

Result

On a fresh set of 107 recordings by seven artists it had never been tuned on, all 60 recordings it marked verified were correct, and so were all 192 credits attached to them. By the rule of three, credit precision is at least about 98.4% at 95% confidence.

Coverage: 68–86% of the recordings Discogs holds reach verified, and 96–98% surface at some tier. Adding MusicBrainz raises writer coverage from 47% to 77% of non-independent recordings.

Contact Abdulrhman

Running a DICOM viewer under a strict Content Security Policy

Browse all articles