xbmc/xbmc — pull request #1109 by jmarshallnz (2012-06-30 23:28:55+00:00)
Title: Music thumbs to cache

This is in no way complete - I'm sure there's areas that will no longer have thumbs after this, as music thumbs were all over the show all using slightly different techniques - I'll continue testing it and adding any fixes on top (to be rebased at the end). Hopefully I hit the majority, but I can't test everything, right? Further, with #1040 being cleaned up to go in, it makes sense to get this in at the same time so that things can be integrated.

Things to discuss are:

1. This needs a rescan, which currently isn't implemented. The trick is going to be sorting out when the rescan can occur. ATM we update the db on first open, which could potentially occur before the skin is fully up (startup scripts) so this will need a bit of thought. Also, we only want to scan tags, not download album/artist info, so it needs a bit of work on the scanner (basically the scanner should take in a set of flags as to what we want it to do).

2. This will almost certainly be slower (from the users perspective) at processing thumbs (though it's done off-thread) - in particular, items later in the list will wait on items earlier - this would almost certainly be noticeable in the Songs node which even in modest collections are quite long. There are several potential solutions to this:
* Having an extra field in the songview/albumviews with the unnormalised art. This would bring it back to how the musicdb thumbs used to operate, though we're now capable of setting more than just the thumb.
* Changing the bg thumbloader to run from the item during processing, rather than on the list from start to finish (i.e. when processing the UI during the render loop we'd run the thumbloader on the item if it hadn't already been run)
* We could have a caching layer on the thumbloader that hits ram rather than the db.

3. There's areas where we use only the pre-cached file thumb rather than the library thumb (upnp for ex) which will need some work - same applies to videos here - figured that @alcoheca would be changing things in this area so didn't spend much time here (plus have no way of testing easily atm).

4. This deprecates a HTTP-API function (fetching of album thumb based on album+albumartist).

5. There's some orphaned functions in CPicture that I'll clean up afterwards. In addition, there needs an additional function to CxImage (load image file in memory) for embedded art that I'll look to add over the next couple of days.

Comments/criticisms most welcome.