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).
Balls,

sorry complete fail on reading to the end ofthe contributing instructions there. Will do flake8 once I get back to a proper computer.

Joe


---- Lasse Bigum wrote ----


In mopidy/local/json.py<https://github.com/mopidy/mopidy/pull/921#discussion-diff-22253064>:

>  import mopidy
>  from mopidy import compat, local, models
>  from mopidy.local import search, storage, translator
>  from mopidy.utils import encoding
> -
> +from urllib import unquote_plus


You probably need to kill the newline before and insert one after (try flake8)

—
Reply to this email directly or view it on GitHub<https://github.com/mopidy/mopidy/pull/921/files#r22253064>.




This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it. 

Please do not use, copy or disclose the information contained in this
message or in any attachment.  Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.