mirror of
https://github.com/beetbox/beets.git
synced 2025-12-29 20:12:33 +01:00
Merge pull request #3567 from nmeum/remove-query-converter
web plugin: support path queries
This commit is contained in:
commit
39e6d21cc7
2 changed files with 11 additions and 3 deletions
|
|
@ -177,10 +177,11 @@ class QueryConverter(PathConverter):
|
|||
"""
|
||||
|
||||
def to_python(self, value):
|
||||
return value.split('/')
|
||||
queries = value.split('/')
|
||||
return [query.replace('\\', os.sep) for query in queries]
|
||||
|
||||
def to_url(self, value):
|
||||
return ','.join(value)
|
||||
return ','.join([v.replace(os.sep, '\\') for v in value])
|
||||
|
||||
|
||||
class EverythingConverter(PathConverter):
|
||||
|
|
|
|||
|
|
@ -210,7 +210,14 @@ If the server runs UNIX, you'll need to include an extra leading slash:
|
|||
``GET /item/query/querystring``
|
||||
+++++++++++++++++++++++++++++++
|
||||
|
||||
Returns a list of tracks matching the query. The *querystring* must be a valid query as described in :doc:`/reference/query`. ::
|
||||
Returns a list of tracks matching the query. The *querystring* must be a
|
||||
valid query as described in :doc:`/reference/query`. Path elements are
|
||||
joined as query keywords. For example, ``/item/query/foo/bar`` will be
|
||||
converted to the query ``foo,bar``. As this conflicts with using a slash
|
||||
character as a path seperator in path queries, a backlash character
|
||||
should be used in these queries instead. This character is converted to
|
||||
the path seperator actually used by the operating system before the
|
||||
query is performed. ::
|
||||
|
||||
{
|
||||
"results": [
|
||||
|
|
|
|||
Loading…
Reference in a new issue