Album Cleaner

Why Navidrome splits one album into several

And why it sometimes merges two albums into one. What decides it, checked against a real Navidrome, and how to fix each cause with the tools you already have.

The rule

Navidrome gives every track an album ID, and the tracks that share an ID are one album. You can’t see the ID, but you see what it does: an album that turns up twice in the library, each copy holding some of the tracks, or an album with tracks missing that are sitting in another album of the same name.

With the default settings, the album ID is made from the first of these that the track has:

  1. The MusicBrainz album ID (MUSICBRAINZ_ALBUMID), if it is a valid UUID. When it is there, nothing else counts.
  2. Otherwise these four together: album artist, album name, album version and release date.

That is the whole rule. The folder the files are in is not part of it, and neither is the disc number. So an album splits when its tracks disagree on any one of those four, or when only some of them carry a MusicBrainz ID. And two albums merge when they agree on all of them, wherever they sit on disk.

To check it, we wrote 22 test albums of two tracks each with ffmpeg, each pair differing in one thing, and let a fresh Navidrome 0.63.2 with default settings scan them. The tables below give what it made of every one. Three more cases follow from the rule but were not scanned; they are marked.

If you have set PID.Album in your Navidrome configuration, the album ID is built your way and this page doesn’t apply as written.

Release date: the split you don’t see coming

Most taggers show one “Year” or “Date” field. Navidrome keeps two dates apart: the release date, which is part of the album ID, and the date (the recording date), which is not. Which tag is which depends on the file:

  • FLAC: RELEASEDATE, or else YEAR, is the release date. DATE is not.
  • MP3: the TDRL frame is the release date. The usual year field (TDRC, or TYER in older tags) is not.
  • M4A: there is only one date, ©day, and Navidrome reads it as the release date. So in M4A files the ordinary date field splits albums.
CaseWhat differed between the two tracksNavidrome made
T01 M4A: the date (©day) is 2020-01-01 on one track and 2021-02-02 on the other 2 albums
T16 M4A: the date (©day) is 2020 on one track and 2020-05-01 on the other 2 albums
T02 M4A: the same date (©day) on both tracks 1 album
T19 FLAC: RELEASEDATE differs 2 albums
T04 FLAC: YEAR differs 2 albums
R01 MP3: TDRL, the ID3 release date, differs 2 albumsby the rule, not scanned
T03 FLAC: DATE differs 1 albumthe album’s date shows blank
T05 MP3: the date (TDRC) differs 1 albumthe album’s date shows blank

Two things stand out. In M4A files, 2020 on one track and 2020-05-01 on another are two different release dates, and two albums. Albums downloaded track by track, or with bonus tracks added later, often end up like this. It is also why an album kept partly in FLAC and partly in M4A can split even when the tags look the same: the M4A tracks have a release date and the FLAC tracks, with only DATE, have none (by the rule, not scanned). And where the tracks only disagree on the recording date, they stay one album, but the album’s date is shown blank.

Fixing it

Give every track the same release date, in the tag that file type uses. In a tag editor (Mp3tag, foobar2000, kid3, MusicBrainz Picard), select every track of the album and type the date once. For FLAC from the command line:

metaflac --remove-tag=RELEASEDATE --set-tag=RELEASEDATE=2020-05-01 *.flac

To get a year back on an album that shows none, make DATE the same on every track as well.

Compilations and albums split by artist

Navidrome takes the album artist from ALBUMARTIST. When a track has none, it uses ALBUMARTISTS; then, if the compilation flag is set, “Various Artists”; and only then the track’s own first artist. That last step is where albums come apart: a track with no album artist is filed under whoever performs on it.

The first artist is the first value of ARTISTS if the track has that tag. Otherwise it is the ARTIST tag, cut at  / ,  feat. ,  ft.  or ;  when it holds a single value. That is why a guest appearance doesn’t split an album, while a compilation with no album artist splits into one album per artist.

CaseWhat differed between the two tracksNavidrome made
T07 No album artist on either track; the artist is Alpha on one and Beta on the other 2 albums
T08 The same two tracks, with the compilation flag set on both (COMPILATION=1) 1 albumfiled under “Various Artists”
T06 No album artist on either track; the artist is Solo on one and Solo feat. Guest on the other 1 albumfiled under Solo
T14 Album artist on one track only, the same name as the other track’s artist 1 album
T15 Album artist on one track only, a different name from the other track’s artist 2 albums

Fixing it

Put the same album artist on every track. For a compilation that is usually “Various Artists”, or set the compilation flag on every track instead (COMPILATION=1 in FLAC, TCMP in MP3, cpil in M4A; most editors call it “Compilation” or “Part of a compilation”).

metaflac --remove-tag=ALBUMARTIST --set-tag="ALBUMARTIST=Various Artists" *.flac

Album names that look the same

When the library shows two albums with exactly the same name, the names are usually not quite the same. Navidrome ignores letter case and treats curly and straight quotes and dashes as equal. Everything else counts.

CaseWhat differed between the two tracksNavidrome made
T09 Album and album artist differ in letter case only 1 album
T17 Album name with a straight apostrophe (Don't) on one track and a curly one (Don’t) on the other 1 album
T10 Album name with a space on one track and a non-breaking space on the other 2 albums
T21 Album name with a trailing space on one track 2 albums
T20 Album name with an é stored as one character on one track (NFC) and as e plus an accent on the other (NFD) 2 albums

A non-breaking space, a trailing space or an accent stored the other way round is invisible in most tag editors, so the albums look identical. Retyping the album name in one go, with every track selected, writes the same characters to all of them.

MusicBrainz album ID

A MusicBrainz album ID outranks everything else. That works both ways.

CaseWhat differed between the two tracksNavidrome made
T12 MUSICBRAINZ_ALBUMID on one track only 2 albums
T13 Different album names and different album artists, the same MUSICBRAINZ_ALBUMID 1 album

A track that came from somewhere else, or was re-tagged on its own, may lack the ID the others have, and then it is an album by itself. Copy the ID to the tracks without it, or remove it from all of them; MusicBrainz Picard, run on the whole album, writes it to every track. An ID that isn’t a valid UUID is ignored (by the rule, not scanned).

metaflac --remove-tag=MUSICBRAINZ_ALBUMID *.flac

Album version

ALBUMVERSION (or, without it, MUSICBRAINZ_ALBUMCOMMENT) is there to keep a deluxe edition apart from the original. On some tracks only, it splits the album.

CaseWhat differed between the two tracksNavidrome made
T18 ALBUMVERSION on one track only 2 albums

Give every track the same version, or none.

Multi-disc albums shown as separate albums

The disc number is not part of the album ID, so discs on their own never split an album. When a two-disc set shows up as two albums, the discs disagree on one of the things above. The usual ones are an album name with the disc in it (Album (Disc 1) and Album (Disc 2) are two different names) and a release date that is only on one disc. Give both discs the same album name and put the disc in DISCNUMBER instead. (By the rule; the scan had no multi-disc case.)

Two albums merged into one

Because the folder is not part of the album ID, two albums with the same tags are one album to Navidrome, even in different folders. Tracks with no album name at all go together into one “[Unknown Album]” per artist, from anywhere in the library. Tracks with no artist of any kind end up under “[Unknown Artist]”.

CaseWhat differed between the two tracksNavidrome made
T11 Nothing in the tags; the two tracks sit in two different folders 1 album
T22 Two unrelated tracks in two folders, neither with an album tag, both by the same artist 1 albumboth under “[Unknown Album]”

Fixing it

Give every track an album name. To keep two releases of the same album apart, give them different release dates, an album version, or their own MusicBrainz IDs.

Missing cover art

Navidrome looks for an album’s cover in a fixed order: an image file named cover in the album’s folder, then folder, then front, then the picture embedded in the tracks. A cover saved as scan.jpg or under the album’s name is not among them. This was not part of the scan; it is the default of Navidrome’s CoverArtPriority setting, cover.*, folder.*, front.*, embedded, external, as its artwork documentation gives it.

The sure fix is both: a cover.jpg in the album’s folder, and the same picture embedded in every track, for the apps that show a track’s own artwork.

Artists joined with a semicolon

Navidrome reads ARTISTS as a list, one artist per value, and never cuts a value up. Written as one value, Nujabes; Shing02 is a single artist with a semicolon in its name: it gets its own artist page, and on a track with no album artist it becomes the album artist too.

CaseWhat differed between the two tracksNavidrome made
R02 No album artist; ARTISTS is the single value Nujabes; Shing02 on one track and Nujabes on the other 2 albumsby the rule, not scanned
R03 No album artist; ARTISTS is the single value A;B on one track and A on the other 2 albumsby the rule, not scanned

The cure is to write the tag once for each artist. In FLAC:

metaflac --remove-tag=ARTISTS --set-tag=ARTISTS=Nujabes --set-tag=ARTISTS=Shing02 track.flac

Check the result with metaflac --export-tags-to=- track.flac, which prints each value on its own line. ffprobe joins repeated values with “;”, so in its output the right tags and the wrong one look the same.

Where each tag lives

The same field has a different name in each kind of file. These are the names this site reads and writes, through TagLib, the library Navidrome reads tags with as well.

FieldFLACMP3M4A
AlbumALBUMTALB©alb
Album artistALBUMARTISTTPE2aART
Release dateRELEASEDATE, else YEARTDRL©day
Date (not in the album ID)DATETDRCnone
Album versionALBUMVERSIONTXXX:ALBUMVERSION----:com.apple.iTunes:ALBUMVERSION
MusicBrainz album IDMUSICBRAINZ_ALBUMIDTXXX:MusicBrainz Album Id----:com.apple.iTunes:MusicBrainz Album Id
CompilationCOMPILATIONTCMPcpil

What this was tested on

A fresh Navidrome 0.63.2 in Docker, default configuration, scanned on . Each test album was two short tracks written by ffmpeg, under an album name of its own so no two cases could merge. The files, the tags each was written with and the number of albums Navidrome made are in the repository as navidrome.groundtruth.js, and the rule as identity.js.

The cases marked “by the rule, not scanned” follow from the same rule and were not run through Navidrome. Navidrome has had releases since (0.64.2 is the latest at the time of writing), and a later one may change its defaults. If what you see disagrees with this page, the scan is easy to repeat.

This site is an independent project, not affiliated with Navidrome. For Navidrome’s own word on tagging, see its tagging guidelines.

Let the cleaner do it

Drop the album’s folder or zip on the Album Cleaner. It shows how many albums Navidrome would make of it and which of the causes above are behind it, fixes the tags in your browser without re-encoding the audio, and gives the album back as a zip. Nothing is uploaded.