@
DaveBlake , yeah the album name could be an issue unless it's tied/filtered by artist also. Basically, the addon parses the metadata in the stream by grabbing Kodi's infoLabels to get track & artist of whatever is currently playing. It then tries to find an associated album (album by that artist with that track on) and looks for artist logo, albumart, discart and track info. All of this is saved into its own db. It uses local art where possible, but falls back to art from theaudioDB if available.
Because of the way it works, initially the only info it has to work with is a track name and an artist name. It does an initial lookup on musicbrainz for the artist mbid, then looks for a local logo for the artist. It then does a search on theaudioDB for an album by that artist containing that track (this is cached so subsequent lookups are much faster) but it
can cause issues because it takes the first result from the search. It might for instance ask for a Bryan Adams track and get a result of Anthology (which would technically be correct) although the track might have appeared first on 'Waking up the Neighbours'. I don't see an easy or fast way of actually determining this so I just use the first returned album. In some cases, this is indeed a 'greatest hits' compilation.
Now, obviously at this point, I won't know the musicdb artistid
or the albumid (if it even exists) so I guess I'll need to use a JSON query to get the artistid (which I'll cache for the future) and then another to look for the album title, flitered by artistid.
OR
Can I look up the relevant data with mbids ? At the point I need to lookup the art, I've already got the artist mbid and tadb returns an album mbid (which I don't currently use, but it's trivial to get). I looked at the json spec for Leia, but it appears that I would need the internal artist and album id's rather than the mbids to search on.
With regard to your first point, yes I had to make assumptions about how the actual music files were laid out and where particular graphics would be located. Scraped stuff would have indeed been missed and the addon would have downloaded and cached (what it considered missing items) itself, even though they might actually have been available to kodi via other addons or scrapers.
Just as an afterthought, does the musicdb contain any track info ? My addon scrapes theaudiodb and last.fm for info on the currently playing track and sets a window property so that a skin can display it. EG, for 'Alive' by Pearl Jam it would display this -
"Alive" is a song by the American rock band Pearl Jam. "Alive" was Pearl Jam's first single, and appeared on the band's debut album, Ten (1991). Written by guitarist Stone Gossard, "Alive" originated as an instrumental titled "Dollar Short" and was included on a demo tape circulated in hopes of finding a singer for the group. Vocalist Eddie Vedder obtained a copy of the tape and wrote lyrics that describe a true account of the time when he was told that the man he thought was his father was not actually his biological parent. It's guitar solo is ranked 44 on Guitar World's "100 Greatest Guitar Solos".
To be honest, I don't even know if the scrapers return this level of detail but it's easily available online so my addon grabs and caches it. If it's in the musicdb, then that's a lookup I won't need to do if a local album exists as the data will already be there, I'll just cache data for non-local albums.
I'm aware that my use-case here is probably quite niche, but Kodi is our only means of media consumption, be that live TV, films, radio, music or whatever. It's all shared around the house and runs on every TV. So, if I listen to the radio (and in some rooms, the TV needs to stay on) I like it to look as good as possible.
I'll shut up now, but I'll probably be back with more questions !!