mopidy/mopidy — pull request #921 by joemarshall (2014-12-24 07:57:38+00:00)
Title: Feature/advanced search

Some updates I've done to the default local backend / library to provide a single search/find_exact advanced_search method, with support for::

1)Passing a desired return type, so for example, the list_albums command now only returns the list of albums - fixes:
https://github.com/mopidy/mopidy/issues/913

2)Passing through the 'limit' and 'offset' parameters, so you potentially can page through things (and they're not ignored), fixes:
https://github.com/mopidy/mopidy/issues/917

3) Listing all types of thing in response to a search (album, artist and track), not just track. All things have a browse URI, so when you click on an album in musicbox, it lists that album. Fixes:
https://github.com/mopidy/mopidy/issues/920

For other backends, it drops through to the old search methods if advanced_search isn't implemented.

The json backend loads the tracklist into a memory sqlite database because the search for album/artist functions were becoming a bit convoluted, it has the bonus of being significantly faster.

On the down-side, this might need some consideration before merging in, in particular:
1) It currently (same as the sqlite backend) only supports a single artist field. I've currently left this just taking the first artist.
Potentially it could 1)use a ; delimited list of artists, which would break exact search for multi-artist searches.
2) For browsing and URIs to work, for albums that don't have an albumartist listed, it chooses one from the song artists to put in the URI. Similarly, it takes date from songs for albums without a date.
3) I had to put more metadata in the test data in tests/local/test_library because of the way this code brings metadata across to make the URI browsing work (2).