Kodi Community Forum
Release Artist Slideshow addon (with skin and addon integration) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: Release Artist Slideshow addon (with skin and addon integration) (/showthread.php?tid=124880)



RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - capfuturo - 2013-09-10

(2013-09-06, 23:32)pkscuot Wrote: Um, not really. Big Grin

In theory the override slideshow option shouldn't keep the bio from showing correctly, and I just checked the code to make sure. By deleting the addon_data folder for AS, you mostly reset it to factory default. AS is complicated enough now that it is possible that some set of settings are somehow conflicting, or that the upgrade from 1.5.3 to 1.5.4 just didn't go well for you.

Anyway, I'm glad stuff is working for you.

BTW, the actual order of searching for the MBID is:

1- ask XBMC
2- check for the .nfo file
3- ask MusicBrainz (via the logic I provided before)

That way once an artist MBID has been found and cached, AS doesn't have to ever ask for it again. If AS doesn't find one, after a couple of weeks it will try again. Retrying every time slows things down and is hard on the MusicBrainz server.

Good afternoon pkscuot,

Thanks for your reply and the additional info that might help further. However there has been no success in retrieving the TheAudioDB bio besides 'Tori Amos''. I uninstalled AS, erased all the user database and started from scratch to no avail. The rest of the bios keep coming ridiculously cut and in most cases unreadable with no logic in it due to random truncation of the original text in Last.fm. I have done a new test (more of the same really) whilst playing a very well known artists called 'Marillion'. According to the log, XBMC handles the artist name correctly to AS, however AS can't do a MBID match and continues to look for local NFOs... and ends up getting the Las.fm bio.

Full debug log here

Questions:
  1. Is there no way to get the MBID from the ID tags embedded in the track that is being played, if it does exist [the MBID tag]? Can XBMC handle that to AS, can't it?
  2. If AS clearly mishandles the name of the artist and no MBID match is being done, why not having AS getting the artist's MBID from XBMC in first place before asking for the artist name?
  3. I believe AS could even get the MBID by just checking the tags in the local track being played, right?
Thank you for bearing with me on this!


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - lr10 - 2013-09-10

(2013-09-10, 13:07)McMuzz4 Wrote: Hi pkscuot,

Your statement is very untrue - your information was actually very, very helpful and drove me find motivation to explore to discover a solution and create a patch!! Big Grin

tl;dr: For some reason Spotimc doesn't like the many repeated JSON requests to the API (though i'm not sure why it only stutters beginning from playback of the second song) - I've posted my solution below.

long version:
After studying the debug log I determined that the pausing occurs exactly when the info is logged "CSoftAEStream::GetFrame - Underrun". Each time this occurred was shortly after a JSON query from artist slideshow that you mentioned. After a bit of googling i discovered that audio stutting + JSON queries could be related to a possible bug with Linux and AudioEngine: http://forum.xbmc.org/showthread.php?tid=147822 where large amounts of JSON queries cause stuttering. I'm still at a loss why the stuttering occurs only after the first song finishes - but anyway..

So I perform some testing:

My first test was I edited the Artist Slideshow python script to allow the first song play through then sleep the artist slideshow script when the second song starts for 10 to 40 seconds, just before the JSON request. This didn't result in anything positive it began stuttering/skipping when AS script finished sleeping.

My second test was to detect if a Spotify stream is playing and pause every second before the JSON query. This resulted in a little less stuttering, so i continued to adjusting until i found a sweet spot at 10 seconds to stop the songs stuttering/skipping. But this was frustrating because while it solved the problem it prevented AS from functioning nice and quickly and took a very long time for artist information to populate, sometimes not until a few songs of playback.

My third test which I have put below is my solution - it will detect if a new song is playing that is a Spotify stream, and if so it will perform the JSON call once and store the response value in a variable. It will then use the stored JSON response to query artist information and not won't call the JSON API again until a different song starts playing

My patch consists of the following, I made changes to two functions:

(btw I'm sure it could be done better I've never used python before - also sorry but I've never contributed to code before so apologies if I should be doing this differently)

Hi!
I'm very interested in this, but I couldn't get your patch to work when I tried to add it manually. I might have done something wrong. Any chance you could upload the file with the modification?


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - pkscout - 2013-09-11

(2013-09-10, 16:10)capfuturo Wrote: Is there no way to get the MBID from the ID tags embedded in the track that is being played, if it does exist [the MBID tag]? Can XBMC handle that to AS, can't it?
MusicBrainz support in XMBC is definitely not complete yet. As far as I know XBMC does not read the MBID tag in an MP3 file. In fact, I don't think that's even a standard MP3 tag. The only way the MBID could get into XBMC is if a scraper puts in there. If that happens then, in theory, AS requests that from XBMC and would get it back. I say in theory because I have no way to test it, as none of my music has the MBID in the XBMC database. I put that code there just to try and be ready in case MusicBrainz support comes to XBMC 13.

Quote:If AS clearly mishandles the name of the artist and no MBID match is being done, why not having AS getting the artist's MBID from XBMC in first place before asking for the artist name?
Technically AS does ask XBMC for the MBID first. See post 644 just above for the order in which AS tries to get the MBID.

Quote:[*]I believe AS could even get the MBID by just checking the tags in the local track being played, right?
I guess in theory if the tag was in the file, XBMC would tell me the file location, and I wrote an entire parser to interrogate the file directly, then yes. But that isn't going to happen. AS asks XBMC for any data about the playing song. What I am able to get back is totally dependent on XMBC.

I looked through your log file, and unfortunately it wasn't much help. From the looks of it the artist you were playing when logging was one that has recently been looked up by AS. If AS can't find a MBID, it writes out a blank file and then waits 2 weeks before trying that particular artist again. I'd suggest you delete the entire userdata/addon_data/script.artistslideshow folder, reset all your preferences and then run everything with debug logging.


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - pkscout - 2013-09-11

(2013-09-10, 13:07)McMuzz4 Wrote: My third test which I have put below is my solution - it will detect if a new song is playing that is a Spotify stream, and if so it will perform the JSON call once and store the response value in a variable. It will then use the stored JSON response to query artist information and not won't call the JSON API again until a different song starts playing

I like your idea of caching the JSON response not just for SpotifyMC, but generally. I really don't need to make JSON calls every time. I've updated AS using your code as a starting point so that it only makes one JSON call at the beginning and then uses the cached response until a different file is playing.

Here's the 1.5.5.001 beta with those fixes. I've tested it only to make sure it doesn't crash and that it behaves the same as 1.5.4 for normal uses.

https://github.com/pkscout/script.artistslideshow/releases/download/v1.5.5.001/script.artistslideshow.zip

Let me know how this works for you.


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - McMuzz4 - 2013-09-11

(2013-09-11, 03:13)pkscuot Wrote: I like your idea of caching the JSON response not just for SpotifyMC, but generally. I really don't need to make JSON calls every time. I've updated AS using your code as a starting point so that it only makes one JSON call at the beginning and then uses the cached response until a different file is playing.

Here's the 1.5.5.001 beta with those fixes. I've tested it only to make sure it doesn't crash and that it behaves the same as 1.5.4 for normal uses.

Let me know how this works for you.

Wow!

That's Awesome! I've downloaded and played some tunes and its 100% with full bio's and images and silky AS goodness, and no skipping!

The link landed me a 404 in git so I downloaded the master zip which seems right.

Thanks for adding this to your script Blush it's great to have this all functioning again, and I've learned a bunch o' stuff along the way and to see it transformed is amazing.

I'm off to spin some more tunes - you are a gentleman and a scholar!


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - pkscout - 2013-09-11

(2013-09-11, 15:15)McMuzz4 Wrote: That's Awesome! I've downloaded and played some tunes and its 100% with full bio's and images and silky AS goodness, and no skipping!

The link landed me a 404 in git so I downloaded the master zip which seems right.

Thanks for adding this to your script Blush it's great to have this all functioning again, and I've learned a bunch o' stuff along the way and to see it transformed is amazing.

No worries. You did the hard work of figuring out the problem and presenting a solution. I just refined it a tiny bit. I have also fixed the link in the post above, so if other SpotifyMC folks want to download it, that's fine. I'm going to do burn in testing on my system (probably this weekend). If that goes well I will push the update to the XBMC repo folks by early next week.


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - capfuturo - 2013-09-12

@McMuzz4: Good night McMuzz4, may I ask what skin are you using that gives you full artist bios and what is the source of the bios if you are able to identify them (theAudioDB or Last.fm)?


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - capfuturo - 2013-09-12

Good night pkscuot,

Thanks for your reply. I also read in the cdART Manager thread that Gotham apparently is delivering support for the Musicbrainz tags, if the rumour is correct. In the meantime:

I erased everything as you suggested and installed the new version 1.5.5 (master from Github). AS returned the full bio from theAudioDB for the artist 'Marillion' on first play which made me think "Oh, finally this is fixed'. I went into the userdata–> add-on_data–> script.artistslideshow–> artistsinformation–> 52991789 and found multiple NFO files and amongst them there were a theaudiodbartistbio.nfo and a musicbrainz.nfo, both containing data. I check the MBID within the musicbrainz.nfo and it matches the artists actually; does this mean XBMC handled that MBID to AS and then AS wrote the file? I thought XBMC 12.2 isn't doing that yet. Anyway, Get fthe older here

I played a different artists and the issue with truncated bios quickly returned once again. I then erased all the user add-on again and reinstalled AS, and guess what happened: AS pulled in the truncated Last.fm! I went into the folder mentioned in the above paragraph and found new files within the artists folder 52991789 and this time there were no theaudiodb NFOs or musicbrainz.nfo (with the MBID in it); only lastfm NFOs. Check here

The lastfmartistsbio.nfo has the full bio in it but what AS shows on the view when I play the artists is something totally truncated that makes no sense. It actually cuts the bio right where it finds an url within the lastfmartistsbio.nfo, which leads me to think there is an issue somewhere handling bios with links in them, since the text for the bio within the NFO should be plain text, stripped from all its url links useful only when one is browsing last.fm. Please see the following two examples:

For Marillion:
AS shows: "Marillion are a rock band formed in Aylesbury, England. Their 30-year career is marked by two distinctive phases; the early years fronted by "
lastfmartistsbio.nfo created by AS here

For Bob Marley:
AS shows on slideshow (which is totally nonsense): "Bob Marley and The Weilers were a raggae band created in 1974 by on drums and bass respectively... "
lasfmartistbio.nfo created by AS here

I don't really know how to fix this in a way that I can have AS working reliably and with consistent results. If AS works reliably and without throwing the results I have posted on this thread for other users, then I wonder what could be wrong. Am I perhaps not supposed to run AS with Aeon Nox because they aren't really 100% compatible?


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - pkscout - 2013-09-12

(2013-09-12, 01:28)capfuturo Wrote: I erased everything as you suggested and installed the new version 1.5.5 (master from Github). AS returned the full bio from theAudioDB for the artist 'Marillion' on first play which made me think "Oh, finally this is fixed'. I went into the userdata–> add-on_data–> script.artistslideshow–> artistsinformation–> 52991789 and found multiple NFO files and amongst them there were a theaudiodbartistbio.nfo and a musicbrainz.nfo, both containing data. I check the MBID within the musicbrainz.nfo and it matches the artists actually; does this mean XBMC handled that MBID to AS and then AS wrote the file? I thought XBMC 12.2 isn't doing that yet.

No, what you saw indicates the AS was able to query MusicBrainz to get a MBID for the artist. Once AS gets a valid MBID, it writes it to that file so that it never has to go looking for it again. theaudioartistbio.nfo is created if AS finds an artist bio from that site. So, as with the first .nfo file, that one indicates a bio was found. AS caches that locally so that it doesn't keep going back to the web site for the info. Every couple of weeks the cache is aged out (except the MBID, that is never aged out) and refreshed from the web site.

At this point you are trying too many things at once and not providing me any information that would help me figure out what you issue is. Please do the following:

1- quit XBMC
2- delete the entire userdata–> add-on_data–> script.artistslideshow directory.
3- start XBMC
4- set your AS preference however you would like
5- start debug logging
6- quit and restart XBMC
7- play songs from three artists (I don't really care who)
8- quit XBMC
9- post the debug log and post a link to it here

P.S. your issues have nothing to do with the skin you are using. AS provides the data to the skin. The only thing the skin does is decide how to display the data. So unless your skin is doing something else (like grabbing bios on the fly), that's not where the issue is.


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - capfuturo - 2013-09-12

Hi pkscuot,

Thanks for your reply.

Please find debug log here (AS brought back only last.fm truncated bios for the three artists)

Debug log was too big to post it to xbmclogs.com this time.

Thanks in advance


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - pkscout - 2013-09-12

(2013-09-12, 03:16)capfuturo Wrote: Please find debug log here (AS brought back only last.fm truncated bios for the three artists)

A little preamble to explain how AS tries to find a MBID for an artist so that my explanation of your issues will make some sense. The MusicBrainz server prefers to give you back lots of possible matches for a given search, but AS would really like "exact" matches. Because of this, AS uses the following procedure to search MusicBrainz:

1- ask MusicBrainz for a list of artists that "match" the currently playing artist
2- take that list and iterate through it looking for an artist whose name exactly matches the currently playing artist
3- when an exact match is found, ask for a list of all that artist's albums
4- iterate through the album list looking for a "begins with" match for the currently playing album (i.e. "Legend" would match "Legend of a Band")
5- if AS finds a match, it returns the MBID for the artist
6- otherwise ask for a list of all the songs for the artist
7- iterate through the song list same as above but matching on currently playing song
8- if AS finds a match, it returns the MBID
9- if no match, go to the next matching artist and start the whole thing again
10- if nothing is found, return an empty string

So now to your three songs:

1- AS finds an artist matching Marillion, but no album or song match. Why? Because the name of the album in MusicBrainz uses the extended character for an apostrophe, but you are using the single quote. A small difference, but it is the difference between match and no match.
2- AS finds an artist match for Bob Marley & The Wailers, but no album or song match. Why? the MusicBrainz album name is "Legend:" instead of what you have, which is "Legend - " I didn't check the song, but the same logic applies.
3- AS finds no artist match because there is no artist named Tori Amos feat. Damien Rice. Multiple artists in XBMC must be separated by a " / " to be parsed as separate artists. AS also supports putting featured artists in the title of the song - i.e. song name (feat. artist)

This is the pain that is MusicBrainz support. So you have three options right now.

1- Fix your metadata so that it matches what's in MusicBrainz.
2- Override the artist bio (and potentially images and other info) with info from a local override file (see the wiki on how to do that).
3- Manually add the correct MBID to the empty musicbrainzid.nfo file in the Artist Information directory.

All of these will be time consuming, and the third one would be a downright pain in the ass.

Having said all that, if you really are storing the MBID as a tag in the MP3 file, then there might actually be an XBMC built in way to get that back. Could you somehow get me one of your MP3 files so that I can see how the tags are constructed? No guarantees, but I'll look at it.


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - Martijn - 2013-09-12

At least for gotham if there's an mbid tag in the mp3 xbmc will take it and put it in db.
Also consider if you found the right id with AS upload it to the db using jsonrpc so you don't have to use the search next time


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - pkscout - 2013-09-12

(2013-09-12, 07:03)Martijn Wrote: At least for gotham if there's an mbid tag in the mp3 xbmc will take it and put it in db.
Also consider if you found the right id with AS upload it to the db using jsonrpc so you don't have to use the search next time

That's good to know. Given that I think I'll ask folks to wait until Gotham if they have MBIDs in their MP3 files. Right now I'm caching the MBID into a file, so a successful search is only done once right now. I'll look into adding it to the XBMC database instead.


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - capfuturo - 2013-09-12

(2013-09-12, 01:28)capfuturo Wrote: The lastfmartistsbio.nfo has the full bio in it but what AS shows on the view when I play the artists is something totally truncated that makes no sense. It actually cuts the bio right where it finds an url within the lastfmartistsbio.nfo, which leads me to think there is an issue somewhere handling bios with links in them, since the text for the bio within the NFO should be plain text, stripped from all its url links useful only when one is browsing last.fm. Please see the following two examples:

For Marillion:
AS shows: "Marillion are a rock band formed in Aylesbury, England. Their 30-year career is marked by two distinctive phases; the early years fronted by "
lastfmartistsbio.nfo created by AS here

For Bob Marley:
AS shows on slideshow (which is totally nonsense): "Bob Marley and The Weilers were a raggae band created in 1974 by on drums and bass respectively... "
lasfmartistbio.nfo created by AS here

Good mornig pkscuot,

Thanks for the reply, I will review it. In the meantime, have you had the chance to review the above regarding the way the lastfmartistbio.nfo is actually displayed by AS? It is this issue that I was trying to refer to when I asked out whether AS and Aeon Nox are compatible or not. If I can't get the theAudioDB bios at least I believe I should get the lasfm bio properly displayed. The theAudioDB bios don't come with urls in their text therefore they are displayed in their entirety. Do you see my point?

Thanks,


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - scott967 - 2013-09-12

(2013-09-12, 07:03)Martijn Wrote: At least for gotham if there's an mbid tag in the mp3 xbmc will take it and put it in db.
Also consider if you found the right id with AS upload it to the db using jsonrpc so you don't have to use the search next time

What is the format that gotham looks for in the "mbid" tag? Specifically in APEv2 tag which is what I use on mp3s? Also works for FLAC (Vorbis comment)?

scott s.
.