Release Artist Slideshow addon (with skin and addon integration)
(2016-05-20, 19:11)pkscout Wrote: Sure. Here's the logic for getting the MusicBrainzID (which I need for fanart.tv for sure, and helps both theaudiodb and htbackdrops return more accruate results).

1- AS asks Kodi for the MBID of the playing artist (or artists) via a JSON call
2- If nothing is returned, then it checks to see if there is a cached MBID on disk
3- If not, then it asks MusicBrainz for a list of artists that match the current artist
4- AS takes that list, starts at the top, and asks for all the albums for that artist
5- It takes that list and compares to the currently playing album, if match found, it writes the MBID out to a cache file
6- if no album match, AS asks for all the songs form an artist
7- It takes that list and compares to the currently playing album, if match found, it writes the MBID out to a cache file
8- If no matches, go back to #3 and try the next artist
9 - eventually AS will give up and write out a blank file, wait 2 weeks, and try again

I do not love this part of the code, but this was the only way I could pretty much guarantee I'd get back the right MBID or no MBID at all. It's messy and somewhat API call intensive for prolific artists (or obscure ones), but it works pretty quickly with popular artists. BTW, I do a song check because if you're listening to a radio stream there is almost never album information.

I'm hoping at some point MBID will be something Kodi scrapes when moving music into the library (or is it doing that now??) Then the only time the alternate code would be needed is for music streams.
I'm open on ideas on how this could be done differently.


For music in the library, my position would be it should be the responsibility of the user to properly tag the music files with MBID. I wouldn't apply much computing resource in trying to fix what the user didn't or couldn't (or provide a setting switch to not search for MBID for music in the library). That leaves streaming music which I don't see an easy answer for.

scott s.
.
Reply


Messages In This Thread
New Test Version Available - by pkscout - 2012-03-08, 16:26
[No subject] - by mardup - 2012-03-10, 12:26
[No subject] - by pkscout - 2012-03-11, 01:35
RE: - by mardup - 2012-03-12, 17:50
RE: - by pkscout - 2012-03-13, 03:22
New Beta Version for Testing - by pkscout - 2012-07-13, 17:54
New Beta Version for Testing - by pkscout - 2012-07-14, 22:50
Pull Request for v1.4 Submitted - by pkscout - 2012-07-20, 23:01
New Beta Version for Testing - by pkscout - 2012-08-10, 03:18
New Frodo BETA Support Files - by pkscout - 2012-11-21, 06:20
New 2.0.0 Beta Coming Soon - by pkscout - 2016-05-12, 02:54
RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - by scott967 - 2016-05-20, 23:16
Writing tips - by Parkerbup - 2017-02-03, 14:56
Add-on Artist Slideshow - by jo26 - 2014-08-08, 22:58
Logout Mark Read Team Forum Stats Members Help
Artist Slideshow addon (with skin and addon integration)5