Kodi Community Forum

Full Version: Testing JSON Music Interface
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am trying to fix some of the problems with getting consistent artist information for song and albums. Currently JSON retruns data derrived from the song and album tables, that is just a descriptive artist string and can differ from the full data in the song_artist and album_artist tables. This approach also means that Musicbrainz IDs can not be returned.

I''ve no problem doing the code changes, and will raise a PR soon. But Montellese is going to be away for a month so it may not get mereged for a while depending if anyone will sign off work in his absence. But just wondering if there is any test routines, or someone willing to do some testing, to ensure that my changes don't have adverse effects.
Please keep the Display Artist thing there, and complete the artists array if the need is more here.

But the displayArtist is really useful to display albums with 10 artists in small device screens Smile

Not a lot of time for the next week or 2 weeks, but can do regression test with my library and Yatse.
(2015-10-27, 09:48)Tolriq Wrote: [ -> ]Please keep the Display Artist thing there, and complete the artists array if the need is more here.

But the displayArtist is really useful to display albums with 10 artists in small device screens Smile

Not a lot of time for the next week or 2 weeks, but can do regression test with my library and Yatse.

No worries, not removing any thing, I wouldn't dare Smile

Just making sure that artists names array and ids array always match, and musicbrainzid isn't always blank. Same for albumartist. Started with GetAlbums, then realised that GetSongs and GetRecently... all have the same issue. I doubt that musicbrainz ID get used much, there is very little compliant, but might as well return what is there.

But since I am messing with the underlying queries I would like to test thoroughly. At the moment all I can do is fire commands at my dev version of Kodi from the address line of my web browser, very tedious and I am likely to miss something. I will do a PR, hope that someone will build it, and be very grateful for any testing you could do.
count on me to test things also
(2015-10-27, 11:59)DaveBlake Wrote: [ -> ]I doubt that musicbrainz ID get used much, there is very little compliant, but might as well return what is there.

Not used much for as you know it never much worked.
Coincidentally, as you you intend to now fix some of this, when i realized thiings as is werent going to work for me I started and now near completing some tangential programming I made to query for and extended the metadata information.
Of course Id prefer there is built in functionality supported by the horde, so ill give the it a run as well.

just how does one know which build it gets into?
OK guys, I have raised a PR PR8306 with my fixes in. I am dependant on a team member making a build for you to test, if they do it will get mentioned there. But I'm hoping this will happen sooner rather than later despite the merge window being closed.

Should give consistent artist arrays - resolving an issue that you won't have noticed unless your music used the ARTISTS tag. But now actually gives MBIDs too, and querying artistID is more efficient (although genreids will still slow things). I would be delighted for you to test it.

There are still issues with setting song and album data, that is another ball of wax, but one thing at a time.
Added PR:8306 to the latest RPi OpenELEC test build #1027.
Installed and testing with a 50k song library.

Since starting fresh even on GB network hexa core i7 it will take a few hours just to scrape Sad

Won't be able to test MBIDs at all as this library is not tagged with them and I doubt scraper add them ?
@DaveBlake

Finally was faster than planned since I forget the scan does not scrape albums / artists you need to force them after in corresponding view ...

Anyway after a very quick test (Will do more when more time) I've seen some subtle changes (I've send you a PM with a link to dl the mp3's to reproduce) but no major breakage.at least on my MBID less library.

I have an album that bug kodi since a long time and never retag it for tests.

When looking at the tags all looks good but Kodi remove the first letter of the Artist on some songs for an unknown reason.

Previously the album would be added half under the artist "The Corrs" and half under "he Corrs" and 2 artists would be created.

Now only one artist "The Corrs" is created, there's still 2 albums created, one with display artist as "The Corrs" and one as "he Corrs" but both are tagged with only one artist "The Corrs".

When browsing the songs for both albums the display Artist and Artist is "The Corrs".
Thanks guys for getting into this, making builds available and trying it out, your support is appreciated.

(2015-10-28, 12:01)Tolriq Wrote: [ -> ]Finally was faster than planned since I forget the scan does not scrape albums / artists you need to force them after in corresponding view ...

Yes you can skip the scraping, nothing I have changed looks at that additional data. Also an existing database would have updated, so you could have saved scanning the tag data too (depending on version). But good to do the full from scratch test too.

Quote:Anyway after a very quick test (Will do more when more time) I've seen some subtle changes (I've send you a PM with a link to dl the mp3's to reproduce) but no major breakage.at least on my MBID less library.

Thanks, good to have some quick feedback, and more testing when you have time is very welcome. Would be good to hear from a Musicbrainz ID user, but since few noticed it was broken I am not expecting many to notice it is fixed.

Quote:I have an album that bug kodi since a long time and never retag it for tests.

When looking at the tags all looks good but Kodi remove the first letter of the Artist on some songs for an unknown reason.

Previously the album would be added half under the artist "The Corrs" and half under "he Corrs" and 2 artists would be created.

Now only one artist "The Corrs" is created, there's still 2 albums created, one with display artist as "The Corrs" and one as "he Corrs" but both are tagged with only one artist "The Corrs".

When browsing the songs for both albums the display Artist and Artist is "The Corrs".

Odd behaviour, must be something to do with the tags. I will have a look.
@Tolriq

It seems that your library is not entirely lacking in MBIDs. Smile

That problem Corrs album has MBIDs (broken ones), and other faulty Musicbrainz tags and they are messing things up. If you asked JSON to return them then it would now at least show the IDs (I hope).

ALBUMARTIST and ARTIST is set to "The Corrs", but some of the tracks also have a MUSICBRAINZ ALBUM ARTIST = "he Corrs". For mp3 files Kodi reads this tag into album artist overriding the ALBUMARTIST tag contents.

The MUSICBRAINZ ALBUM ARTIST ID and MUSICBRAINZ ARTIST ID tags are also missing a first character, so scraping would not correctly identify it. Basically the tagging is a mess, easy to see using Mp3tag, and Kodi does its best with the data it is given.

See if you can see "artistid", "artist", musicbrainzartistid", "albumartistid", "albumartist", "musicbrainzalbumartistid" for these tracks, it should show you what Kodi has scanned in.
You are right Wink Never looked at those advanced tags as the normal ones where ok.

Anyway there's a change in handling those problematic mp3 Smile Don't know if it's wanted or not.

All songs have the same data :

PHP Code:
{"albumartist":["The Corrs"],"albumartistid":[829],"artist":["The Corrs"],"artistid":[829],"musicbrainzalbumartistid":["acf6c776-d0f6-4239-b5a2-a45a613ffa52"],"musicbrainzartistid":["acf6c776-d0f6-4239-b5a2-a45a613ffa52"]} 

And the Albums are returned as :

PHP Code:
{"albumid":1075,"artist":["The Corrs"],"artistid":[829],"label":"Talk on Corners","musicbrainzalbumartistid":["acf6c776-d0f6-4239-b5a2-a45a613ffa52"],"musicbrainzalbumid":"59ef148-90a3-44ab-87b2-1252c46febd5","title":"Talk on Corners"},{"albumid":1076,"artist":["The Corrs"],"artistid":[829],"label":"Talk on Corners","musicbrainzalbumartistid":["acf6c776-d0f6-4239-b5a2-a45a613ffa52"],"musicbrainzalbumid":"","title":"Talk on Corners"

Meaning same artist too but missing mb album id (not in the tags so maybe normal).

But the mb artist id is not tagged too on those 2 tracks that generate the duplicate album, so where does it comes from ?

And why all artists data point correctly to The Corrs but display artist on one album take the bad "he Corrs" ?

IMO there's some strange mix between MBID and TAGS and maybe place for some more fixes Smile
(2015-10-29, 18:04)Tolriq Wrote: [ -> ]You are right Wink Never looked at those advanced tags as the normal ones where ok.

Anyway there's a change in handling those problematic mp3 Smile Don't know if it's wanted or not.

Well I have not changed how Kodi handles the mixed up tag data, not this time around any way. I have had an effect on what you see. You now see what Kodi is storing, so I hope that is a wanted change.

Quote:All songs have the same data :

PHP Code:
{"albumartist":["The Corrs"],"albumartistid":[829],"artist":["The Corrs"],"artistid":[829],"musicbrainzalbumartistid":["acf6c776-d0f6-4239-b5a2-a45a613ffa52"],"musicbrainzartistid":["acf6c776-d0f6-4239-b5a2-a45a613ffa52"]} 

And the Albums are returned as :

PHP Code:
{"albumid":1075,"artist":["The Corrs"],"artistid":[829],"label":"Talk on Corners","musicbrainzalbumartistid":["acf6c776-d0f6-4239-b5a2-a45a613ffa52"],"musicbrainzalbumid":"59ef148-90a3-44ab-87b2-1252c46febd5","title":"Talk on Corners"},{"albumid":1076,"artist":["The Corrs"],"artistid":[829],"label":"Talk on Corners","musicbrainzalbumartistid":["acf6c776-d0f6-4239-b5a2-a45a613ffa52"],"musicbrainzalbumid":"","title":"Talk on Corners"

Meaning same artist too but missing mb album id (not in the tags so maybe normal).

But the mb artist id is not tagged too on those 2 tracks that generate the duplicate album, so where does it comes from ?

And why all artists data point correctly to The Corrs but display artist on one album take the bad "he Corrs" ?

Kodi is not a tagging tool, messed up tags need fixing but Kodi can't guess what you got wrong or even know there is something wrong. Neither is Kodi reporting the tags in the files, it returns the library contents processed from those tags. Here is an explanation of what Kodi did with those particular messed up tags:

The key thing is the order in which songs and albums are created, and that MBIDs are given presidence. The first file scanned was tagged as
ARTIST = "The Corrs"
(ALBUMARTIST = "The Corrs" but gets over written by MUSICBRAINZ ALBUM ARTIST)
MUSICBRAINZ ARTIST ID = "acf6c776-d0f6-4239-b5a2-a45a613ffa52"
MUSICBRAINZ ALBUM ARTIST = "he Corrs"
MUSICBRAINZ ALBUM ARTIST ID = "acf6c776-d0f6-4239-b5a2-a45a613ffa52"
MUSICBRAINZ ALBUM ID = 59ef148-90a3-44ab-87b2-1252c46febd5

Song processed first and song.strArtists = "The Corrs", and entry in the artist table is created from the artist tags with artist.strArtist = "The Corrs" and artist.MBID = "acf6c...".

Then, because we have an musicbrainzalbumid an album is created immediately with album.strArtists = "he Corrs" (what is in the Musicbrainzalbumartist tag). But we already have an entry in the artist table for the MBID given in musicbrainzalbumartistID, so the album is linked to this artist, differences in name are ignored.

Consequently read back this song and you will get "The Corrs" as both artist and albumartist and (song) display name. But for the album you will get "The Corrs" as artist (from the artist and album_artist tables) but "he Corrs" as (album) display name from the album table.

Then we scan track 07, that does not have any Musicbrainz tags just
ARTIST = "The Corrs"
ALBUMARTIST = "The Corrs"

Without MBID artist is matched on name only, we have an artist called "The Corrs" so this link is stored in the song_artist and album_artist tables. But, unlike artists, we do not match albums without MBID to those with them by name alone. Hence another album is created with the same name as that with thew MBID.

Quote:IMO there's some strange mix between MBID and TAGS and maybe place for some more fixes Smile

Not sure what you would have fixed? Kodi is only reflecting the strange mix of musicbrainz tags you have in the files. With musicbrainz tags you either use them fully, consistently and accurately or remove them from the files, otherwise you will get odd effects.
So if I had first scanned an album with artist The Corrs without MBID then scanned a new one with the MBID what happens ? (Like 2 different albums)

2 artists are created ? (Was the case before) Or there's a name match and the MBID is added to the first artist ?
What about different artists with the same name ? (Rare but pretty sure this exists)

About artist again :

MUSICBRAINZ ARTIST ID = "acf6c776-d0f6-4239-b5a2-a45a613ffa52"
MUSICBRAINZ ALBUM ARTIST = "he Corrs"

So why does Kodi creates the artist with The Corrs and set the artist id from MBID?

IMO this : "Song processed first and song.strArtists = "The Corrs", and entry in the artist table is created from the artist tags with artist.strArtist = "The Corrs" and artist.MBID = "acf6c...". " is not logical when you say that MB have presidence.

In that case all MB tags should have presidence and not a mix with the normal tag for name and the MBID for the id as this leads to the mix.

Nowhere in the TAGS there's a link between The Corrs and the MBID.

My point is that ok the files are messed up, but Kodi should have created 2 albums and 2 artists and use all MB data for one and none for the other.
Current mix is incomplete and it's hard for users to understand what TAG is used when, there's no point to have perfect MB data if an invalid normal TAG value can overwrite those.

Should be either MB > All or All > MB.
Pages: 1 2