Duplicate MusicBrainzTrackID within the same album
#1
Hi

I noticed something unexpected when listening to some of my music in my Kodi library. I was listening to a box set of singles from an artist which are all part of the same "album" in Kodi. My music is tagged with MusicBrainz tags and one of the tracks on this box set appears twice and has the same MusicBrainzTrackID. What I noticed was the first occurrence of this track was missing from the Kodi database.

I have a couple of albums that have multiple tracks of silence, and therefore the same MusicBrainzTrackID, and noticed that in both occurrences only the last track in each case was showing in the Kodi.

Digging a bit further and having a look directly at the database I can see that in the songs table that idAlbum and strMusicBrainzTrackID are a unique index so based on that I think the behaviour above is to be expected.

I have temporarily got round this issue by simply removing the MusicBrainzTrackID tag from the affected tracks and re-scanning my library but it's not an ideal situation.

I don't know if this would be classed as a bug or not but is there a preferred way of dealing with this situation?

The most annoying thing from my point of view is that I can apply my workaround where I know there is an album with duplicate tracks but with a large library I could have tracks missing that I am not aware of.
Reply
#2
Interesting issue. Could you let me know the album Musicbrainz id and/or link in Musicbrainz for that release, or releases if you have more than one album.

As you noted Kodi has been designed assuming that track ids would be unique within an album, after all most do not have a repeated track. I had no idea that MB would give repeated silence the same id, but I guess it makes sense in some ways.

Quote:I don't know if this would be classed as a bug or not but is there a preferred way of dealing with this situation?
I think it is a "design oversight", Kodi has simply not been designed to deal with repeated tracks on the same album. It is something I would like to think about before diving in with a database change.

Removing the track mbid tag, or maybe better editing it to keep a kind of mbid there, but adding something to make it unique on the album would be my suggestion for now.

Quote:The most annoying thing from my point of view is that I can apply my workaround where I know there is an album with duplicate tracks but with a large library I could have tracks missing that I am not aware of.

I really would expect it to be rare. I can not think of any other example than a repeated silence. Any variation in recording would result in a different mbid. Do they use the same track id for silence on all albums (regardless of artists etc.)? If they do, I would say search your db for that MusicBrainzTrackID, and then albums for those songs are the albums that may have missing tracks. Otherwise a song count to file count comparison may show things.
Reply
#3
Hi

The two releases with the silent tracks are:

https://musicbrainz.org/release/986fee20...43e0ff840e
https://musicbrainz.org/release/ce44c3b3...0a0f5b6603

The one with the duplicate track is:

https://musicbrainz.org/release/28465118...d8f9fc2ed5

In this case the track "Song 2" with the same recording ID appears on both CD 17 and CD 20.

Interestingly for the silent tracks it appears the recording ID is shared for that release or artist but not across other releases so there isn't just the on ID shared by all silent tracks.

Hope that helps but if you need any more information please let me know.
Reply
#4
Thanks that is very useful, although the whole thing is a little bit hair-tearing!

So musicbrainz track id needs track and disc number as well to be unique. Not sure quite what I am going to do with that information just yet, but I will give it some thought.

Real world music collections will never cease to surprize and amaze me Smile
Reply
#5
I have confirmed that the Musicbrainz data model allows for a many to many relationship between recording and release (it was not just a data entry error by contributors), and so Kodi needs to accomodate that.

After a small bit of thought, it actually is not difficult to adapt Kodi to the fact that Musicbrainz Track ID is not unique on an album. Smile

So I have implemented a fix such that Kodi will load these duplcate recordings correctly, but since this issue has been around unoticed since Eden (not that many people have those albums tagged with mbids I guess), and it requires a bump to the db version, it will not go into v17 at this late stage.

@Hallucyn8 if I create a win32 build would you be able to test it on your music collection? Your system may not be windows based, but you could perhaps install on a PC or laptop just for testing?
Reply
#6
Sure, no problem, my main set up is on a Raspberry Pi but more than happy to install on Windows and test
Reply
#7
Great, I'll post here when I have a build up on the mirrors (may not be until next week, the servers are being hammered with the v17 release).

My home system is RPi based too, but building into LE is a bit beyond me yet and the Millhouse nightly builds are usually based on merged PRs.
Reply
#8
Well that was quicker that I expected Smile

A win32 test version is here http://mirrors.kodi.tv/test-builds/win32...ckMBID.exe
This is a patched v18 pre alpha, so I suggest you install outside program files folder so you can run in portable mode.

As well as a patch for the duplicate MusicbrainzTrack Ids it has an artist sort name facility, using ARTISTSORT etc. tag values rather than artist name when sorting by artist. Maybe you like to try that out too? It really depends if you would like to see Dolly Parton down in the "P"s not the "D"s, and have the tags in your music. It is enabled via advancedsettings.xml

But priority is to see it pick up the missing duplcated tracks (where you have not edited the tags to work around the issue). Let me know how it goes.
Reply
#9
I've installed and tested with the version that you posted and can confirm that the tracks with duplicated MusicbrainzTrack IDs are now all present and correct Smile

I'll have a look at the artist sorting but not had chance to do this yet
Reply
#10
Thanks for the feedback, it should get into v18, just a bit of delay while I have several things to get approved and merge in order.

To try out artist sorting you will need to have scanned music files with ARTISTSORT, ALBUMARTISTSORT or COMPOSERSORT tags, and then enable it via adding to advancedsettings.xml
Code:
<musiclibrary>
    <promptfulltagscan>true</promptfulltagscan>  <!-- update library asks if want to rescan regardless of files unchanged -->
    <artistsortonupdate>true</artistsortonupdate> <!-- after scanning/scraping propagates the artist sort names to albums and songs -->
    <useartistsortname>true</useartistsortname>
</musiclibrary>
Reply
#11
Wow, DaveBlake the long awaited ArtistSort feature is amazing!
But as far as I understood it's only in that new builds, following version 17.0, right?
Any chance to see it in a 17.01 or 17.1 version? Big GrinBig GrinBig Grin
Reply
#12
(2017-02-07, 12:05)unclefester Wrote: Wow, DaveBlake the long awaited ArtistSort feature is amazing!
But as far as I understood it's only in that new builds, following version 17.0, right?
Any chance to see it in a 17.01 or 17.1 version? Big GrinBig GrinBig Grin
Sorry no. Addition of new features to Krypton was frozen months ago, and 17.1 will only contain essential bug fixes. The development cycle moves ever forwards....

It also takes time to get things reviewed and into v18 nightlies. In the meanwhile I will try to create builds for users to test, as is the case here.
Reply

Logout Mark Read Team Forum Stats Members Help
Duplicate MusicBrainzTrackID within the same album0