command/Database: add "sort" parameter to "find" and "search"

Implement the second part of https://bugs.musicpd.org/view.php?id=3990
This commit is contained in:
Max Kellermann
2017-02-08 09:22:15 +01:00
parent 1e0a60e73d
commit 3850716522
7 changed files with 178 additions and 9 deletions

View File

@@ -1590,6 +1590,7 @@ OK
<arg choice="req"><replaceable>TYPE</replaceable></arg>
<arg choice="req"><replaceable>WHAT</replaceable></arg>
<arg choice="opt"><replaceable>...</replaceable></arg>
<arg choice="opt">sort <replaceable>TYPE</replaceable></arg>
<arg choice="opt">window <replaceable>START</replaceable>:<replaceable>END</replaceable></arg>
</cmdsynopsis>
</term>
@@ -1636,6 +1637,18 @@ OK
<varname>WHAT</varname> is what to find.
</para>
<para>
<varname>sort</varname> sorts the result by the
specified tag. Without <varname>sort</varname>, the
order is undefined. Only the first tag value will be
used, if multiple of the same type exist. To sort by
"Artist", "Album" or "AlbumArtist", you should specify
"ArtistSort", "AlbumSort" or "AlbumArtistSort" instead.
These will automatically fall back to the former if
"*Sort" doesn't exist. "AlbumArtist" falls back to just
"Artist".
</para>
<para>
<varname>window</varname> can be used to query only a
portion of the real response. The parameter is two
@@ -1833,6 +1846,7 @@ OK
<arg choice="req"><replaceable>TYPE</replaceable></arg>
<arg choice="req"><replaceable>WHAT</replaceable></arg>
<arg choice="opt"><replaceable>...</replaceable></arg>
<arg choice="opt">sort <replaceable>TYPE</replaceable></arg>
<arg choice="opt">window <replaceable>START</replaceable>:<replaceable>END</replaceable></arg>
</cmdsynopsis>
</term>