Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navidrome shows different versions of the same album in one list #1976

Open
koehntopp opened this issue Nov 5, 2022 · 67 comments
Open

Navidrome shows different versions of the same album in one list #1976

koehntopp opened this issue Nov 5, 2022 · 67 comments
Labels

Comments

@koehntopp
Copy link

Description

I have several albums in more than one version - Qobuz Download, CD Rip, extended version....

On the file system, they are stored in separate folders. ALBUM and ARTIST tags are identical, YEAR, CATALOG and many others totally different.

Expected Behaviour

Make albums show up in different versions.

Additional desired behaviour: Show the VERSION and/or SUBTITLE tag in the grid to allow easy selection of the different versions.

@koehntopp koehntopp added the bug label Nov 5, 2022
@dro-ex
Copy link

dro-ex commented Nov 5, 2022

Wouldn’t naming your album with the version work? I.E.:

Tusk (Vinyl)
Tusk (2005)
Tusk (Deluxe)
Meet the Beatles (Stereo)
Meet the Beatles (Mono)

@koehntopp
Copy link
Author

Oh, sure it would. But it would just be circumventing the bug.

If you're trying to manage a music collection programmatically, clean tags are essential.
If you're trying to search for metadata or covers with a manually changed album name, seach will fail.

This is why there are other tags like release year or catalog number that can be maintained to make a release unique.

In my case, all releases are properly linked to discogs, which also adds all kinds of release specific metadata.
To make this accessible, I am putting year, media type and special text like "Deluxe Eidtion" into the VERSION text, which is also displayed by roon in the UI.

@dro-ex
Copy link

dro-ex commented Nov 6, 2022

I see. I came from other music players where not every tag was honored, so I came up with this as well as a tagging structure from classical which is way not a nightmare as well as to help searching for music easier. The requirements where to be able to see version and conductor on an iPod gen 2 screen as well to find quickly in search. I would love it off music players honored, indexed, and played all tags, as everything would still organize correctly via tags but can also be backwards xonpatable with other players. Amazon music tags for instance is a nightmare.

@koehntopp
Copy link
Author

Yep. By now it should be clear that albums in multiple versions are a thing for people who maintain a local library (otherwise you could just use Spotify).

The current behaviour is inconsistent, too - Navidrome ignores folders (which some may consider a feature) and relies on tags, but then does that only well enough to go for album and artist, apparently.

@K4r0qtuYNE5G4qgZ
Copy link

Yeah I also noticed that but I usualy simply add the Media Type to the Abum Name and move on, because i'm currently re-tagging my multi TB Music Library for Navidrome and I just reached "G" after two weeks and can't/don't want to let things like that hold me back for too long.

I also coded some Scripts for MP3Tag that tremendously help me to save time, but with the amount I have to re-tag, sort, cleanup etc. It will still take months, but at least it's done and clean afterwards.

The Issue is that essentially:

Tusk |
Tusk | --> Is the same Album if you don't add Vinyl, 2005 or Deluxe to Title
Tusk |

Meet the Beatles |
Meet the Beatles | ---> Is the same Album if you don't add Stereo, Mono or FLAC to Title
Meet the Beatles |

CATALOGNUMBER, MEDIATYPE, PUBLISHER, COUNTRY and YEAR is ignored for sorting.
All that matters is ALBUM and ALBUMARTIST.

So if you want the same ALBUM to be split eg. the Tracks to appear separately, add CATALOGNUMBER, MEDIATYPE, PUBLISHER, COUNTRY, YEAR to ALBUM.

Or another possibility is to keep the same ALBUM and split them up with DISCNUMBER and SETSUBTITLE like:

ALBUM = Tusk
DISCNUMBER = 1
SETSUBTITLE = Vinyl

ALBUM = Tusk
DISCNUMBER = 2
SETSUBTITLE = 2005

ALBUM = Tusk
DISCNUMBER = 3
SETSUBTITLE = Deluxe

ALBUM = Tusk
DISCNUMBER = 4
SETSUBTITLE = FLAC


ALBUM = Meet the Beatles
DISCNUMBER = 1
SETSUBTITLE = Stereo

ALBUM = Meet the Beatles
DISCNUMBER = 2
SETSUBTITLE = Mono

ALBUM = Meet the Beatles
DISCNUMBER = 3
SETSUBTITLE = FLAC

If done so, they are all sorted into one Album but differentiated internally, which I personally prefer, especially if more then two different dupe Albums, EPs, Singles etc. Because it doesn't clutter the List with duplicate Albums. The only issue I have currently with this is that Navidrome doesn't display different Covers for different SETSUBTITLE, it would be nice if at least a little pic would be shown along with DISCNUMBER, SETSUBTITLE etc.

If you only have some hundred of Albums split them up with ALBUM may be ok, but if you have ten thousands of Albums then it looks a bit different and it gets a bit tedious...

@koehntopp
Copy link
Author

koehntopp commented Nov 6, 2022

Well, I get ALBUM and ARTIST (as well as many other tags) from the Discogs Release that I tag it with. This allows me to go back, pull the data from Discogs, and re-write tags as needed.

Right now I'm putting that part into the VERSION tag - roon will display that in the album list.

Bildschirm­foto 2022-11-06 um 17 05 20

SETSUBTITLE is actually being used in many of my albums, where different discs will get SETSUBTITLE through Discogs data (like here https://www.discogs.com/release/11149783-Queen-News-Of-The-World "New pure analog cut" etc.) which is needed to differentiate different versions of a sing within a single "album" box set.

Bildschirm­foto 2022-11-06 um 17 12 52

I've looked at many of those issues recently, and VERSION seems to be the best bet.

Bildschirm­foto 2022-11-06 um 17 03 52

@aalukacsko
Copy link

Just adding on that this is a showstopper for me. Like @koehntopp I've taken to using VERSION for this (and use discogs too!). That said, it'd be great if we could specify a 'decider' tag - be it VERSION or whatever else that someone might have used. This would just be the last level of deciding how to organize.

At the least, leveraging the folder structure is a passable solution (and what i was using with airsonic advanced), but having the ability to specify a tag for this delineation would be perfect.

Retagging my library just for this is not an option - the size of my library makes this all but impossible and i like how i've organized and tagged my music.

All that said, navidrome is impressive and for me, is soooo close to replacing airsonic (and getting rid of java 🤮 - no offense to my java friends!)

@K4r0qtuYNE5G4qgZ
Copy link

I also pull the data from Discogs or MusicBrainz and then manually adjust it to my needs.

I especially manually adjust every cover (Get the best Quality one, Adjust Size to Square, Adjust Contrast, Exact Crop etc.) but I also adjust the Metadata if wrong which sadly happens a lot (Type Errors, Wrong Tracknumbers(1.1, A1 etc.), Wrong Album Titles, Wrong Artists, Wrong of missing (Discoq never sets it if not Various...) Album Artist etc.)

While MusicBrainz always use the same clean format for Tracknumbers, Discogs is notorious for messing up Tracknumbers, they sometimes use 1.1,1.2,.. or A, B or A1, B1 etc. which Navidrome doesn't recognize and so I also need to correct them. I made a special Discog Fix Script for that purpose which handles all Discogs issues (Yeah there are many...) at once.

So yeah cleaning up all that mess takes a lot of time even with sophisticated scripts I still need to accurately check every Album.

@vs49688
Copy link
Contributor

vs49688 commented Nov 7, 2022

Duplicate of (or very similar to) #489.
If you're using MusicBrainz tagging, then #1363 should fix this.

@K4r0qtuYNE5G4qgZ
Copy link

Duplicate of (or very similar to) #489. If you're using MusicBrainz tagging, then #1363 should fix this.

Unfortunately Musicbrainz(~3,118,675) has way less releases compared to Discogs(~15,000,000) and so it won't be possible to find MusicBrainz IDs for every album.

@vs49688
Copy link
Contributor

vs49688 commented Nov 7, 2022

Ah, yeah then #1363 won't do you much good.

@K4r0qtuYNE5G4qgZ
Copy link

I just had an idea how Navidrome could cleanly handle that once and for all:

Why not just create a hash of (MUSICBRAINZ_ALBUMID + DISCOGS_RELEASE_ID + CATALOGNUMBER + ASIN + BARCODE + MEDIATYPE + PUBLISHER + COUNTRY + YEAR + ALBUM + ALBUMARTIST) and use that hash to always split albums cleanly, guaranteed?

All the Tags I choosen for that hash are expected to be Album specific and missing tags would also not be a problem for the hash, because they would not be taken into account automatically. The only problem would of course be if an album contains files with different album specific tags eg. files from different Albums compiled into one Album etc. but that would be something the user would have to fix either by re-tagging correctly or deleting the tags etc.

And the nice thing about this solution is that it takes into account a large number of combinations in order to always split albums correctly and only a small hash (32-128bit) has to be stored in the database for this.

But if implemented I suggest to add an Option to the Navidrome Config to define which Tags should be used for the Hash like:

AlbumSplitHashTags = "ALBUM, ALBUMARTIST"

The above example would result in the same behavior as it is now and could be the default so that nothing changes for current users. And users who need more or want to differentiate more finely can simply add some more and do a Full Rescan.

@vs49688
Copy link
Contributor

vs49688 commented Nov 7, 2022

But if implemented I suggest to add an Option to the Navidrome Config to define which Tags should be used for the Hash like:

AlbumSplitHashTags = "ALBUM, ALBUMARTIST"

The above example would result in the same behavior as it is now and could be the default so that nothing changes for current users. And users who need more or want to differentiate more finely can simply add some more and do a Full Rescan.

#1363 supports migrating from the current behaviour to using Musicbrainz tags. It would be relatively trivial to adapt it for any arbitrary identification scheme.

I was under the impression that Discogs is a proprietary site (and thus would put in no effort to support it), but it appears I'm mistaken after a quick search.

Another thing to think about is artists, track IDs, etc. MusicBrainz has unique IDs for each "entity". Does Discogs?

Supporting this generically would get a bit nasty. You'd have to have (using your example) AlbumSplitHashTags, ArtistSplitHashTags, MediaFileSplitHashTags, etc, which gets really messy, really quickly.

Instead, perhaps supporting certain indexing "modes" is a better option. E.g. default (current behaviour), musicbrainz (#1363), and discogs (hypothetical)?

IndexMode=default

@deluan Any opinions on this?

@koehntopp
Copy link
Author

But if implemented I suggest to add an Option to the Navidrome Config to define which Tags should be used for the Hash like:
AlbumSplitHashTags = "ALBUM, ALBUMARTIST"

That idea is not all bad. It would cater to most of the different approaches here. The only issue may be people mistyping tags, so maybe a list of checkboxes for all tags that the libraries used can recognize (and help for the purpose) would be easier.

Instead, perhaps supporting certain indexing "modes" is a better option. E.g. default (current behaviour), musicbrainz (#1363), and discogs (hypothetical)?

IndexMode=default

That's slightly problematic. Not all directories support all releases. Both Musicbrainz and Discogs rely on users creating the releases, and most will be happy enough if album title, artist name and track names match.
Discogs support my OCD best, which is why I have gone and created releases for albums that did not have a match. For example, Discogs will often have separate releases for QObuz FLAC and iTunes AAC releases of the exact same album ;)

That's probably the extreme, though, but if I have the original CD or Vinyl rip, and the 5.1 Blu-ray, it would be great to be able to see them as different albums. VERSION so far looks most promising, which is why my little Python script (my personal version of beets, basically) will write them as "2005 DVD-Audio 192kHz HDAD 2011" and "2018 Blu-ray 5.1 96kHz RGM-0725" respectively.

Maybe we should collect starting tags that "matter" for those cases?

@audiomuze
Copy link

audiomuze commented Nov 7, 2022

Navidrome has traditionally aligned with MusicBrainz tagging. The the correct tagname for this is _releasecomment and Picard can be made to pull it when it exists - see https://community.metabrainz.org/t/add-album-version-tag-using-picard/539876.

Given users of at least one software player have taken to using a version tag for this purpose, having the option to map version (or any other user named tag) to _releasecomment would be useful. This way Navidrome maintains alignment with MusicBrainz whilst accommodating users coming from other software.

I like the idea of defining a hash based on user specified criteria, and it'd easily handle version or _releasecomment.

My tagger (puddletag) is set to name folders using %albumartist% - %artist% %version% and that's enough (in my case) to create a unique folder name, so I'd simply configure it to hash the folder name assuming it's exposed in Navidrome.

All told though, relying on MBID is not a sufficiently robust solution because there simply are not enough albums in the MusicBrainz database.

@vs49688
Copy link
Contributor

vs49688 commented Nov 7, 2022

My tagger (puddletag) is set to name folders using %albumartist% - %artist% %version% and that's enough (in my case) to create a unique folder name, so I'd simply configure it to hash the folder name assuming it's exposed in Navidrome.

Like I said earlier, you'd need to support more than just albums:

Another thing to think about is artists, track IDs, etc. MusicBrainz has unique IDs for each "entity". Does Discogs?

Supporting this generically would get a bit nasty. You'd have to have (using your example) AlbumSplitHashTags,
ArtistSplitHashTags, MediaFileSplitHashTags, etc, which gets really messy, really quickly.

Which is why I suggested having preset modes that we can guarantee are supported properly.

All told though, relying on MBID is not a sufficiently robust solution because there simply are not enough albums in the MusicBrainz database.

MusicBrainz can be updated ;)

@K4r0qtuYNE5G4qgZ
Copy link

K4r0qtuYNE5G4qgZ commented Nov 7, 2022

The only issue may be people mistyping tags, so maybe a list of checkboxes for all tags that the libraries used can recognize (and help for the purpose) would be easier.

That setting would be done in the navidrome.toml file which you edit with a texteditor, so forget checkboxes.

#1363 supports migrating from the current behaviour to using Musicbrainz tags. It would be relatively trivial to adapt it for any arbitrary identification scheme.

Yeah and doing #1363 would be as easy as that...:
AlbumSplitHashTags = "ALBUM, ALBUMARTIST, MUSICBRAINZ_ALBUMID"
or
AlbumSplitHashTags = "MUSICBRAINZ_ALBUMID"

Another thing to think about is artists, track IDs, etc. MusicBrainz has unique IDs for each "entity". Does Discogs?

Supporting this generically would get a bit nasty. You'd have to have (using your example) AlbumSplitHashTags, ArtistSplitHashTags, MediaFileSplitHashTags, etc, which gets really messy, really quickly.

MusicBrainz has unique IDs for Albums, Tracks and Artists
Discogs has only DISCOGS_RELEASE_ID which identifies the Release which essentialy is the Album

I also don't exactly get what you mean with ArtistSplitHashTags and MediaFileSplitHashTags?

Because Artists are or should be unique anyway and so the same Artists will always result in the same hash if you mean also hashing Artists? And I dunno if it makes any sense to split by MediaType without Album?

Also only to clarify, the Hash I mean would be builded by concatenating all Tags contained in AlbumSplitHashTags and not hashing each one separately. This is either done by adding up all tags (in the defined order) into a string and then hash the whole or via serial adding each Tag as Data to the Hash, both results into the same hash. And if a Tag doesnt exist in file it also won't get added and so automatically doesn't matter for the hash.

So to also split up Albums by Mediatype would be:
AlbumSplitHashTags = "ALBUM, ALBUMARTIST, MEDIATYPE"

Someone wants to split them up by Publisher?
AlbumSplitHashTags = "ALBUM, ALBUMARTIST, PUBLISHER"

Split up by Country?
AlbumSplitHashTags = "ALBUM, ALBUMARTIST, COUNTRY, MUSICBRAINZ_ALBUMRELEASECOUNTRY, DISCOGS_COUNTRY "

And koehntopp probably would use:
AlbumSplitHashTags = "ALBUM, ALBUMARTIST, DISCOGS_RELEASE_ID, MUSICBRAINZ_ALBUMID, VERSION"

That way it's up to the user to decide what he wants or needs and it is also the user's responsibility to tag their files accordingly.

Personally I probably would use:
AlbumSplitHashTags = "ALBUM, ALBUMARTIST, DISCOGS_RELEASE_ID, MUSICBRAINZ_ALBUMID, MEDIATYPE"
Because I use both Discogs and Musicbrainz and get the data from the one that has the best data for the album I re-tag, sometimes i use both together, sometimes only one, so I would need to add both. I sometimes also do them manually, when the existing tags and covers are good already. But I guess this combo would already cover 99.99% of all Albums.

Also speaking of Discog's quirks, there's the issue with the track numbers:

Discogs uses A, B, A1. B1, A2, B2 for Vinyl Albums and 1.1, 1.2, 1.3,.. for Albums where all tracks are unsplitted on CD and sometimes also 1a, 1b if they differentiate two Titles within the same Track etc.

Navidrome doesn't handle them and I always need to re-number them with MP3Tag's Auto-numbering wizard.

Here also some of the Tags that Navidrome already reads...:
#1036 (comment)

And here the Tag Field Mappings that MP3tag uses (Perhaps a good Idea to use the same, because they are humanreadabler):
https://docs.mp3tag.de/mapping/

@koehntopp
Copy link
Author

Navidrome has traditionally aligned with MusicBrainz tagging. The the correct tagname for this is _releasecomment and Picard can be made to pull it when it exists - see https://community.metabrainz.org/t/add-album-version-tag-using-picard/539876.

Whatever the solution, ideally it should be based on standard tags from one or more of tags received from Musicbrainz or Discogs.
For the 99% solution, Album Artist, Title, Year and Catalog Number should be able to identify different releases sufficiently well.

Given users of at least one software player have taken to using a version tag for this purpose, having the option to map version (or any other user named tag) to _releasecomment would be useful. This way Navidrome maintains alignment with MusicBrainz whilst accommodating users coming from other software.

I could easily "fill" '_releasecomment' from my VERSION, but that's hardly a good general solution

I like the idea of defining a hash based on user specified criteria, and it'd easily handle version or _releasecomment.

My tagger (puddletag) is set to name folders using %albumartist% - %artist% %version% and that's enough (in my case) to create a unique folder name, so I'd simply configure it to hash the folder name assuming it's exposed in Navidrome.

All told though, relying on MBID is not a sufficiently robust solution because there simply are not enough albums in the MusicBrainz database.

Yep. I just went through 600+ Discogs tags albums, I could not find suitable Musicbrainz releases for about 10% of them, and compromised on others (data OK, year off by 1 or similar)

Discogs and Musicbrainz aside, even if albums are manually tagged with enough data to keep them separate should appear properly...

@K4r0qtuYNE5G4qgZ
Copy link

For the 99% solution, Album Artist, Title, Year and Catalog Number should be able to identify different releases sufficiently well.

Unfortunately, catalog numbers are not always unique, there are a multitude of different albums that have the same catalog numbers. Sometimes even Vinyl and CD releases have the same catalog number. Or purely digitally distributed albums sometimes have none at all, sometimes the same as some CD etc. So the catalog number is not such a good unique identifier.

@koehntopp
Copy link
Author

That setting would be done in the navidrome.toml file which you edit with a texteditor, so forget checkboxes.

I've only been using the Docker version so far, so I have not used navidrome.toml at all
I might look into it, but I'd advocate for a sensible default with standard tags.

MusicBrainz has unique IDs for Albums, Tracks and Artists Discogs has only DISCOGS_RELEASE_ID which identifies the Release which essentialy is the Album

That's.... not really true....

Bildschirm­foto 2022-11-07 um 11 21 47

Also speaking of Discog's quirks, there's the issue with the track numbers:
Discogs uses A, B, A1. B1, A2, B2 for Vinyl Albums and 1.1, 1.2, 1.3,.. for Albums where all tracks are unsplitted on CD and sometimes also 1a, 1b if they differentiate two Titles within the same Track etc.

Navidrome doesn't handle them and I always need to re-number them with MP3Tag's Auto-numbering wizard.

It may be my tagger (Yate on Mac) takes care of this. But it would be great if there was support for other numbering schemes.

There's information in those tags that currently get lost when tagging. In The Alan Parsons Project – Tales Of Mystery And Imagination the B-Side only has two tracks, the first one being a long one with subtitle, that may get lost when tagging.

Bildschirm­foto 2022-11-07 um 12 45 34

@vs49688
Copy link
Contributor

vs49688 commented Nov 7, 2022

Before we go any further, do Discogs tags map to Navidrome's data model? Here's what it is currently, with Musicbrainz tags.

Field Default MusicBrainz Discogs
Track md5(file path) musicbrainz_releasetrackid ???
Album md5(album artist\album name) musicbrainz_albumid ???
Artist md5(artist) musicbrainz_artistid ???
Album Artust md5(album artist) musicbrainz_albumartistid ???

If they don't map directly, is there some combination of fields that can be used to munge a unique key? The main ones to be concerned about are "Track" and "Album", as they all need to globally unique.

An earlier version of #1363 didn't handle "Track" properly and it manifested as tracks missing from albums when they were also present on another.

@koehntopp
Copy link
Author

Before we go any further, do Discogs tags map to Navidrome's data model? Here's what it is currently, with Musicbrainz tags.

Field Default MusicBrainz Discogs
Track md5(file path) musicbrainz_releasetrackid ???
Album md5(album artist\album name) musicbrainz_albumid ???
Artist md5(artist) musicbrainz_artistid ???
Album Artust md5(album artist) musicbrainz_albumartistid ???
If they don't map directly, is there some combination of fields that can be used to munge a unique key? The main ones to be concerned about are "Track" and "Album", as they all need to globally unique.

An earlier version of #1363 didn't handle "Track" properly and it manifested as tracks missing from albums when they were also present on another.

AFAIK that's something for the tagger to solve - Navidrome should be looking at "Artist", "Album" and "Track", which may or may not be set by Discogs or Musicbrainz?

I don't think Navidrome should care how files got their tags. If there are tags for well known databases it can show an icon or link to them, but for normal operation this should not make a difference.

@vs49688
Copy link
Contributor

vs49688 commented Nov 7, 2022

That's the way Navidrome currently works now, and the reason this whole problem exists.

The track/album/whatever hierarchy cannot be uniquely represented using the standard tags alone (without putting all the disambiguating information in them, which is kind of gross).

The only reason it works as well as it does, is because it uses md5(path) as the database ID for a track (media_file in Navidrome nomenclature). If it didn't do that, and relied on tags alone, then you wouldn't even get duplicate tracks in an album - they'd all be collapsed into one.

In order to support this use case, Navidrome needs to support some way of uniquely identifying each album, and each track within an album. Same with artists and album artists, but they're somewhat less noticeable.

I solved this problem for the Musicbrainz case by utilising the Musicbrainz tags. This allows everything to be globally, uniquely identified by tags alone. Using this, I can run beet mbsync (which may move things around behind-the-scenes), trigger a rescan, and all my data, playlists, play count, etc. is still there, and consistent.

This would work similarly for the Discogs case.

@koehntopp
Copy link
Author

That's the way Navidrome currently works now, and the reason this whole problem exists.

Maybe that's why we're discussing it as a bug ;)

The only reason it works as well as it does, is because it uses md5(path) as the database ID for a track (media_file in Navidrome nomenclature). If it didn't do that, and relied on tags alone, then you wouldn't even get duplicate tracks in an album - they'd all be collapsed into one.

Are you sure it does? All my albums are in single folders, so how would two get into one album?

In order to support this use case, Navidrome needs to support some way of uniquely identifying each album, and each track within an album. Same with artists and album artists, but they're somewhat less noticeable.

Does anyone know how other players do this? I'm using the exact same library on roon, Jellyfin and USB Audio Player Pro (Android), and they all get it right. I just tried Swinsian, which also puts them into one album.

I solved this problem for the Musicbrainz case by utilising the Musicbrainz tags. This allows everything to be globally, uniquely identified by tags alone. Using this, I can run beet mbsync (which may move things around behind-the-scenes), trigger a rescan, and all my data, playlists, play count, etc. is still there, and consistent.

This would work similarly for the Discogs case.

Again, more than 10% of my albums do not have a correct MB release.

I like the idea of a hash. I think it's safe to assume that we can come up with quite a lot of tags that should be identical for a release (album artist, album title, year, catalog number, discogs release url, musicbrainz album id, label, publisher, disc count, release country and many others).
The default could be to use all those, so if some are missing it will still work. I don't think there are many people who will have any of those only for single tracks on an album?

@vs49688
Copy link
Contributor

vs49688 commented Nov 7, 2022

That's the way Navidrome currently works now, and the reason this whole problem exists.

Maybe that's why we're discussing it as a bug ;)

Indeed :)

The only reason it works as well as it does, is because it uses md5(path) as the database ID for a track (media_file in Navidrome nomenclature). If it didn't do that, and relied on tags alone, then you wouldn't even get duplicate tracks in an album - they'd all be collapsed into one.

Are you sure it does? All my albums are in single folders, so how would two get into one album?

If Navidrome didn't use md5(path) as a database ID, and instead used, say, a hash of the track name, then the current album-collapsing behaviour would also be done for tracks. I actually hit this exact issue when writing the Musicbrainz patch.

In order to support this use case, Navidrome needs to support some way of uniquely identifying each album, and each track within an album. Same with artists and album artists, but they're somewhat less noticeable.

Does anyone know how other players do this? I'm using the exact same library on roon, Jellyfin and USB Audio Player Pro (Android), and they all get it right. I just tried Swinsian, which also puts them into one album.

It's quite possible it's only using the file path to build the hierarchy, and only using the tags for display purposes.
Would it still work if you copied a bunch of albums into one folder, I wonder 🤔

I'm also using the exact same library for both Navidrome and Kodi. Both get it wrong.

I solved this problem for the Musicbrainz case by utilising the Musicbrainz tags. This allows everything to be globally, uniquely identified by tags alone. Using this, I can run beet mbsync (which may move things around behind-the-scenes), trigger a rescan, and all my data, playlists, play count, etc. is still there, and consistent.
This would work similarly for the Discogs case.

Again, more than 10% of my albums do not have a correct MB release.

Yep, and that's why I suggested implementing a similar thing for Discogs.

I like the idea of a hash. I think it's safe to assume that we can come up with quite a lot of tags that should be identical for a release (album artist, album title, year, catalog number, discogs release url, musicbrainz album id, label, publisher, disc count, release country and many others). The default could be to use all those, so if some are missing it will still work. I don't think there are many people who will have any of those only for single tracks on an album?

A hash would work, but like I said, this would have to be done for tracks, artists, and album artists too. And even then, you'd lose the guarantee that moving files around on-disk won't affect Navidrome.

EDIT: This would also break if you updated the tags, e.g. adding missing information. A rescan would think they're new files as the hash is different.

@K4r0qtuYNE5G4qgZ
Copy link

K4r0qtuYNE5G4qgZ commented Nov 7, 2022

The only reason it works as well as it does, is because it uses md5(path) as the database ID for a track (media_file in Navidrome nomenclature). If it didn't do that, and relied on tags alone, then you wouldn't even get duplicate tracks in an album - they'd all be collapsed into one.

Are you sure it does? All my albums are in single folders, so how would two get into one album?

The Filename is also part of the Filepath and so also part of the MD5, and try to copy two files with identical names into one Folder and look what happens. xD

It's quite possible it's only using the file path to build the hierarchy, and only using the tags for display purposes.
Would it still work if you copied a bunch of albums into one folder, I wonder

Copying 1000 Albums into one Folder doesn't change anything if filenames are unique (OS limitation) and all Files are tagged correctly.

Currently Navidrome splits by Albumtitle, Albumartist, so files to belong to the same Album must at least have the same and unique Albumtitle set or if same Albumtitle each one a unique Albumartist set. If that's the case and all filenames are unique, copying all into one folder is no issue and shouldn't change anything.

Also why do you think Navidrome uses MD5(Filepath) as Database Key?
It's because it's guaranteed to be unique for every File precisely because two files with the same name cannot exist in the same directory. That is perfect to uniquely identify the files for the Database, but has nothing to do with sorting them into Albums.

For then sorting and splitting them into Albums Navidrome reads and uses Albumtitle, Albumartist and to work properly, every single file belonging to this album must have the same album level tags.

Also for me sorting my Library with Folders only, isn't doable because it currently consists of:
1’155’576 Files
74’336 Folders
(They aren't all in Navidrome yet, I successively copy over to Navidrome the Collections, Discographia,... etc. That I re-tagged and then everytime check all Albums in Navidrome for errors before starting working on the next ones...)

This also includes CD1, CD3,.., Disc1, Disc2,.. and whatever album unique Folders and Jpegs, Pngs,.., Textfiles an whatever album unique files. I also normally don't touch the filenames while tagging, so that I don't need to also change the .m3u files. I only rename files when they don't contain any valuable infos at all like (only Track1, Track2, Track3,.. or 1,2,3,.. etc.) only then I rename them into a fixed format (%track% - %artist% - %title%) or (%discnumber%-%track% - %artist% - %title%).

One could now ask why Navidrome doesn't simply use the album directory as the album identification, because two identical directories cannot exist either. Well, what works best for files doesn't necessarily work for directories.

As these examples show:

"X:\Music\Discographia - Vnv Nation - And Extras\VNV Nation - Futureperfect (Live SF)\VNV Nation Live SF CD1\VNV Nation - Carbon.mp3"
"X:\Music\!Collection - Folk_NewAge\Gregorian - Masters Of Chant IV Chapter (2003)\02  Gregorian - Bridge Over Troubled Water.mp3" 
"X:\Music\!Collection - Country\The Byrds - Sweetheart Of The Rodeo (256 Eac)\CD2\The Byrds - 14 - One Hundred Years From Now (alt 1).mp3" 
"X:\Music\!Collection - Goa_Psychedelic\Goa Gil - PsyTrance Collection\Goa Gil - 1998 - @ Burning Man [2CD]\MP3\CD2\214. Ceiba - I'm Normal.mp3" 
"X:\Music\!Collection - 70_80_90\80's\1986\Time Life - The 80s Collection 1986 2cd 192kbps\1986 CD 1\02 - Bananarama - Venus.mp3"
"X:\Music\!Collection - 70_80_90\The Big 80s Collection\Cyndi Lauper - Change of Heart.mp3" 

What exactly should Navidrome use as the album directory?

@vs49688
Copy link
Contributor

vs49688 commented Nov 7, 2022

The only reason it works as well as it does, is because it uses md5(path) as the database ID for a track (media_file in Navidrome nomenclature). If it didn't do that, and relied on tags alone, then you wouldn't even get duplicate tracks in an album - they'd all be collapsed into one.

Are you sure it does? All my albums are in single folders, so how would two get into one album?

The Filename is also part of the Filepath and so also part of the MD5, and try to copy two files with identical names into one Folder and look what happens. xD

Say you had the following:

Artist Album Artist Album Title Path
Nightwish Nightwish Oceanborn Stargazers /music/Nightwish/Oceanborn [TFCK-87179]/01 Stargazers.flac
Nightwish Nightwish Oceanborn Stargazers /music/Nightwish/Oceanborn [UICN-15002]/01 Stargazers.flac
Nightwish Nightwish Oceanborn Stargazers /music/Nightwish/Oceanborn [SPI67SP]/01 Stargazers.flac

You need the file path here in order to disambiguate. If it didn't, all three versions would be collapsed into one. Using the path works because they're individual files, and can't have children. Using the path for albums only really works if your library is sorted correctly on-disk, which I'm pretty sure isn't a requirement of Navidrome.

It's quite possible it's only using the file path to build the hierarchy, and only using the tags for display purposes.
Would it still work if you copied a bunch of albums into one folder, I wonder

Copying 1000 Albums into one Folder doesn't change anything if filenames are unique (OS limitation) and all Files are tagged correctly.

Currently Navidrome splits by Albumtitle, Albumartist, so files to belong to the same Album must at least have the same and unique Albumtitle set or if same Albumtitle each one a unique Albumartist set. If that's the case and all filenames are unique, copying all into one folder is no issue and shouldn't change anything.

I didn't mean for Navidrome, I meant for the other players to see their behaviour. It was just conjecture.

Also why do you think Navidrome uses MD5(Filepath) as Database Key? It's because it's guaranteed to be unique for every File precisely because two files with the same name cannot exist in the same directory. That is perfect to uniquely identify the files for the Database, but has nothing to do with sorting them into Albums.

Yep, never said it wasn't. I said it's the only reason Navidrome can uniquely represent every file. We're agreeing here.

For then sorting and splitting them into Albums Navidrome reads and uses Albumtitle, Albumartist and to work properly, every single file belonging to this album must have the same album level tags.

Also for me sorting my Library with Folders only, isn't doable because it currently consists of: 1’155’576 Files 74’336 Folders (They aren't all in Navidrome yet, I successively copy over to Navidrome the Collections, Discographia,... etc. That I re-tagged and then everytime check all Albums in Navidrome for errors before starting working on the next ones...)

This also includes CD1, CD3,.., Disc1, Disc2,.. and whatever album unique Folders and Jpegs, Pngs,.., Textfiles an whatever album unique files. I also normally don't touch the filenames while tagging, so that I don't need to also change the .m3u files. I only rename files when they don't contain any valuable infos at all like (only Track1, Track2, Track3,.. or 1,2,3,.. etc.) only then I rename them into a fixed format (%track% - %artist% - %title%) or (%discnumber%-%track% - %artist% - %title%).

One could now ask why Navidrome doesn't simply use the album directory as the album identification, because two identical directories cannot exist either. Well, what works best for files doesn't necessarily work for directories.

Because Navidrome isn't meant to care about the directory structure in order to sort them. Directories, names, and paths should be immaterial for sorting, they are (and imo should only be used for) uniquely representing each file.

@koehntopp
Copy link
Author

Say you had the following:

Artist Album Artist Album Title Path
Nightwish Nightwish Oceanborn Stargazers /music/Nightwish/Oceanborn [TFCK-87179]/01 Stargazers.flac
Nightwish Nightwish Oceanborn Stargazers /music/Nightwish/Oceanborn [UICN-15002]/01 Stargazers.flac
Nightwish Nightwish Oceanborn Stargazers /music/Nightwish/Oceanborn [SPI67SP]/01 Stargazers.flac
You need the file path here in order to disambiguate. If it didn't, all three versions would be collapsed into one. Using the path works because they're individual files, and can't have children. Using the path for albums only really works if your library is sorted correctly on-disk, which I'm pretty sure isn't a requirement of Navidrome.

Well, I have this

Bildschirm­foto 2022-11-07 um 23 01 17

Bildschirm­foto 2022-11-07 um 23 03 01

And the Navidrome result is

Bildschirm­foto 2022-11-07 um 23 04 21

So please allow me to remain sceptical about the file path MD5 thingie.

@vs49688
Copy link
Contributor

vs49688 commented Nov 7, 2022

Say you had the following:
Artist Album Artist Album Title Path
Nightwish Nightwish Oceanborn Stargazers /music/Nightwish/Oceanborn [TFCK-87179]/01 Stargazers.flac
Nightwish Nightwish Oceanborn Stargazers /music/Nightwish/Oceanborn [UICN-15002]/01 Stargazers.flac
Nightwish Nightwish Oceanborn Stargazers /music/Nightwish/Oceanborn [SPI67SP]/01 Stargazers.flac
You need the file path here in order to disambiguate. If it didn't, all three versions would be collapsed into one. Using the path works because they're individual files, and can't have children. Using the path for albums only really works if your library is sorted correctly on-disk, which I'm pretty sure isn't a requirement of Navidrome.

Well, I have this

Bildschirm­foto 2022-11-07 um 23 01 17

Bildschirm­foto 2022-11-07 um 23 03 01

And the Navidrome result is

Bildschirm­foto 2022-11-07 um 23 04 21

So please allow me to remain sceptical about the file path MD5 thingie.

Hm? It's working as-intended, using the file path. If wasn't used, there'd only be a single copy of Sirius and Eye In The Sky in that list.

From scanner/mapping.go:

func (s mediaFileMapper) trackID(md metadata.Tags) string {
    return fmt.Sprintf("%x", md5.Sum([]byte(md.FilePath())))
}

func (s mediaFileMapper) albumID(md metadata.Tags) string {
    albumPath := strings.ToLower(fmt.Sprintf("%s\\%s", s.mapAlbumArtistName(md), s.mapAlbumName(md)))
    return fmt.Sprintf("%x", md5.Sum([]byte(albumPath)))
}

func (s mediaFileMapper) artistID(md metadata.Tags) string {
    return fmt.Sprintf("%x", md5.Sum([]byte(strings.ToLower(s.mapArtistName(md)))))
}

func (s mediaFileMapper) albumArtistID(md metadata.Tags) string {
    return fmt.Sprintf("%x", md5.Sum([]byte(strings.ToLower(s.mapAlbumArtistName(md)))))
}

fmt.Sprintf("%x", md5.Sum([]byte(md.FilePath()))) is where the magic happens and is the reason those tracks can be seen.

@audiomuze
Copy link

Irrespective of which direction one takes on this the fact is there isn't a silver bullet in leveraging Discogs, MusicBrainz or any other metadata source. They can lend metadata to help, but 1) none are complete and 2) not all users resort to tagging leveraging either source. On the other hand, every user that has multiple releases of the same album, has in one way or another created a means of discerning one release from another in the players they use. Accept there is no universal standard and that a Navidrome specific decision needs to be made, communicated and then allow mapping of tags to that implementation. This is the only way Navidrome (or any other player) will arrive at a universal answer that works for any user's music that is currently capable of being disambiguated, regardless of what tags, folder names or combination thereof a user has ultimately adopted.

Working on the notion that users must enrich the likes of MusicBrainz in order to be able to make use of a tool like Navidrome is to my mind flawed thinking in that it caters only for like minded people that are prepared to enrich their existing metadata with identifiers from those metadata sources. I'd hope that a solution would aim to solve the problem for all users, irrespective of whether or not they use discogs, musicbrainz or another metadata source.

@koehntopp
Copy link
Author

Any updates...?

@certuna
Copy link
Contributor

certuna commented Nov 23, 2022

Easiest fix for this is just use the Disc Number/Disc Subtitle tags for reissues/etc, this will nicely show the different versions as different discs under 1 master album.

If this is deemed to much of a "hack", another way to do this in an easy way for MB-tagged albums is to use the MB Release ID or Catalog Number as a splitter for "discs" (i.e. in the Web UI album tracklist, sort first by MBID/CAT#, then by Disc Number, with separators in between), this would have the same effect, should be fairly easy to code. Would all be client-side too, only thing the ND API would have to do is pass on the MB Release ID and Cat# for each song of the album.

@K4r0qtuYNE5G4qgZ
Copy link

Easiest fix for this is just use the Disc Number/Disc Subtitle tags for reissues/etc, this will nicely show the different versions as different discs under 1 master album.

Yeah or simply add something after Albumname like [CATALOGNUMBER], (MEDIATYPE), (YEAR) or whatever you like.
I also saw that MB also adds stuff behind Names sometimes if there are two Albums with the exact same names.
The last one was Bargrooves Black the [SEAMCD002] (2004), [BAR019] (2006) both have the same AlbumName and Bargrooves Deluxe the [BARG15CD] (2010), [BARG33D3] (2014) both have the same AlbumName. I saw that MB fixed the later by simply adding (2014) behind the AlbumName but I had to fix the first myself by putting [SEAMCD002] behind the AlbumName. MB also only had the newer ones, the older ones were only on Discogs.

another way to do this in an easy way for MB-tagged albums is to use the MB Release ID or Catalog Number as a splitter for "discs" (i.e. in the Web UI album tracklist, sort first by MBID/CAT#, then by Disc Number, with separators in between), this would have the same effect, should be fairly easy to code. Would all be client-side too, only thing the ND API would have to do is pass on the MB Release ID and Cat# for each song of the album.

Not really, I just ReTagged 207 Albums and out of the 207, only 15 were on MB, 190 were only on Discogs and 2 were nowhere and had to be custom tagged. What I also dislike about MB is the fact that they don't provide any Genre/Style tags. Overall Discogs also provides the better Tag-Quality. The only thing where I prefer MB is the quality of the covers, especially the "XW" and "Digital Media" ones, when available, but unfortunately the limited availability puts a spanner in the works.

But Discogs also sucks, especially with their Tracknumber fckups like sporadic (1.1, 1.2; 1., 2.; A,B,C etc.) instead (1, 2 or 01, 02).

So yeah unfortunately none of the TagSources are foolproof, all need custom fixes and additional work.

Sometimes there are even big fckkups like totally bugged DiscNumbers like (1;1;1;1;1;1;1;1;1;1;1;1;,1,1,1,1,,1,1,1,,1,1,1,1,111111111111) instead (1) or absolutely wrong Titles or Years (2002//2002//2002//2002//2002//2002//2002//2002) instead (2002) and whatever, so unfortunately checking everything carefully is still required even with custom fixes.

Guess with the amount I ReTag I probably meet every bug lol

@certuna
Copy link
Contributor

certuna commented Nov 23, 2022

I think the ideal UI route would be to have one entry for the album in the albums grid/list, but individual editions to be separate when you navigate to that album, right?

@koehntopp
Copy link
Author

I think the ideal UI route would be to have one entry for the album in the albums grid/list, but individual editions to be separate when you navigate to that album, right?

I don't think there is such a thing as 'the ideal UI route' ;)

Allowing for a hash by user defined tags would most likely be the most versatile solution. Anything that can be done within an album, like creating virtual discs, can already be done today. Having separate top level albums based on tags can't.

@audiomuze
Copy link

If this is deemed to much of a "hack"

It is precisely that, a workaround that will at some point rear its ugly head and get in the way of other things one might want to get done. Rather than fudge it, fix the data model.

@flemmingss
Copy link

just wondering, any progress on this "bug"?

@deluan
Copy link
Member

deluan commented Jan 15, 2023

Wow! Don't know how I missed this whole discussion, sorry for that.

I tend to agree with some here that there is no silver-bullet solution. I also use both MB and Discogs, but mostly try to use MB and update their catalog whenever I have time :)

The solution I've been thinking since @vs49688 introduced #1363 is to allow the IDs to be configurable. So each of these functions could be configured to generate a hash of specific tags:

func (s mediaFileMapper) trackID(md metadata.Tags) string 
func (s mediaFileMapper) albumID(md metadata.Tags) string
func (s mediaFileMapper) artistID(md metadata.Tags) string 
func (s mediaFileMapper) albumArtistID(md metadata.Tags) string

These functions could be configured to use a combination of any tag. This is basically the AlbumSplitHashTags idea suggested by @K4r0qtuYNE5G4qgZ, but for all IDs Navidrome uses, not only albums. Options for hashing would include FilePath, MBIDs, album folder, so it would potentially handle all discussed use cases in this thread, even for those users that don't want/know how to add "compilation" to their album tags.

I think this is a mix of #1363 and the AlbumSplitHashTags A set of these configs would be equivalent to the "modes" @vs49688 suggested. We would also need a way to seamless change from one "mode" to another, as I don't want to reimport all my library and loose all my playlists, etc...

I'll think more about it and maybe work on that (based on #1363) for next release.

@deluan
Copy link
Member

deluan commented Jun 3, 2023

Hey folks, I'm doing some work towards a solution for this. Can someone send me a couple of "duplicate" albums, with Discogs and VERSION tags? Preferable one FLAC and one MP3. If you can help, send it to deluan @ navidrome . org

I've looked at many of those issues recently, and VERSION seems to be the best bet.

Bildschirm­foto 2022-11-06 um 17 03 52

@koehntopp Where is this code snippet from?

@dweymouth
Copy link
Contributor

dweymouth commented Jun 3, 2023

So each of these functions could be configured to generate a hash of specific tags

Really nice idea! This would really help both supporting multiple album versions, and being able to ignore file paths entirely so you can rename files and directories without losing metadata. Is there any chance this configuration could allow for simple Boolean logic? (e.g. use MusicBrainz album ID IF present ELSE fallback to Album+Album Artist)

@audiomuze
Copy link

audiomuze commented Jun 4, 2023

Hey folks, I'm doing some work towards a solution for this. Can someone send me a couple of "duplicate" albums, with Discogs and VERSION tags? Preferable one FLAC and one MP3. If you can help, send it to deluan @ navidrome . org

@deluan you have mail. Same PW on both archives.

@deluan
Copy link
Member

deluan commented Jun 4, 2023

Thanks @audiomuze and @flemmingss. Which taggers did you use?

@flemmingss , I don't see any version tag, nor any discogs tags in your files. How are you planning to disambiguate the releases? By release date (date tag)?

I still need one mp3 album or at least a couple of mp3 songs from the same album, with the tags above, so I can see how the same tags are stored in ID3v4.

@certuna any ideas?

@deluan
Copy link
Member

deluan commented Jun 4, 2023

Really nice idea! This would really help both supporting multiple album versions, and being able to ignore file paths entirely so you can rename files and directories without losing metadata.

Yep 😎. This will also allow multiple artists with the same name

Is there any chance this configuration could allow for simple Boolean logic? (e.g. use MusicBrainz album ID IF present ELSE fallback to Album+Album Artist)

I though about this, but I don't see a situation where it would be better than just doing Album+Album Artist+MusicBrainzAlbumID.

@dweymouth
Copy link
Contributor

Yeah I guess the only benefit I can think of is if you added an album that was mistagged and you could later correct the title/album artist without Navi seeing it as a new album. But this shouldn't come up often.

@audiomuze
Copy link

Which taggers did you use?

Picard and puddletag.

@VlaK0r
Copy link

VlaK0r commented Oct 1, 2023

Hello, friends!
Is there currently a solution to this problem?

@phw
Copy link
Contributor

phw commented Oct 28, 2023

In #1036 it is mentioned:

TDRL Release date of the album, used to disambiguate various re-releases: different releasedate tag = different album

But this does not seem to be actually used. If it would it probably already would solve the issue for many cases, at least for re-releases.

@deluan
Copy link
Member

deluan commented Dec 23, 2023

@VlaK0r I'm working on this, but the current "solution" is to make album names different ("Low Life" and "Low Life (Deluxe Edition)") or using different release dates.

@phw See the 0.50.0 release notes about "Album splitting by Original/Release date"

@audiomuze / @flemmingss Sorry, but I changed computers last month, and I lost your files. The links you both sent me are expired. Do you mind sending me the files again? Thanks!

@phw
Copy link
Contributor

phw commented Dec 23, 2023

@deluan Yes, saw it. For my use case this already solves separating the albums. Thanks a lot for this.

@deluan
Copy link
Member

deluan commented Dec 23, 2023

For the folks using discogs metadata, do you recommend any macOS tagger that gets info from Discogs? @koehntopp / @K4r0qtuYNE5G4qgZ which taggers are you using?

@flemmingss
Copy link

@VlaK0r I'm working on this, but the current "solution" is to make album names different ("Low Life" and "Low Life (Deluxe Edition)") or using different release dates.

@phw See the 0.50.0 release notes about "Album splitting by Original/Release date"

@audiomuze / @flemmingss Sorry, but I changed computers last month, and I lost your files. The links you both sent me are expired. Do you mind sending me the files again? Thanks!

https://nextcloud.flemmingss.top/s/HKpWpwSHcMHasPF 👌

@koehntopp
Copy link
Author

For the folks using discogs metadata, do you recommend any macOS tagger that gets info from Discogs? @koehntopp / @K4r0qtuYNE5G4qgZ which taggers are you using?

I've been using Yate https://2manyrobots.com/yate/ forever for Discogs and Musicbrainz tagging.

Happy Christmas!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests