ejurgensen/forked-daapd — pull request #75 by couteau (2014-12-27 18:09:59+00:00)
Title: Add back support for individual media artwork

This pull request re-adds support for individual artwork, including support for caching individual artwork.

The first commit adds back basic support for individual artwork. When a request for an individual media item's artwork is made, this logic looks first for embedded artwork and then for a jpg or png file in the same path and with the same base name as the media file. If no individual artwork is found, then it proceeds with the existing search for group artwork pertaining to the item (including a search of the cache).

The second and third commits add support for caching individual artwork. The second commit modifies the artwork cache table and api to allow for distinguishing between individual artwork and group artwork. Because persistent ids for individual media and persistent ids for groups might clash, an addition field in the artwork cache table is necessary to identify the correct artwork for a given item or group. This commit adds this field, artwork_type, which can be 0 for group artwork and 1 for individual artwork. It also adds this field to the persistentid index so that selects will be optimized. It modifies the functions cache_artwork_get and cache_artwork_add (and their internal implementing functions) to add a corresponding artwork_type argument. Finally, it updates artwork.c to make the existing calls to cache_artwork_add and cache_artwork_get pass in an artwork_type parameter.

The third commit modifies the individual artwork logic to look for individual artwork in the cache and then to add the individual artwork to the cache if none was found there.