Handle sort parameter in DAAP queries

This is used by Remote for the Title view.
This commit is contained in:
Kai Elwert 2010-08-03 23:28:46 +02:00 committed by Julien BLACHE
parent 5d69a8e34c
commit ca72ee5926

13
src/httpd_daap.c Normal file → Executable file
View File

@ -902,6 +902,19 @@ get_query_params(struct evkeyvalq *query, struct query_params *qp)
qp->idx_type = I_SUB;
qp->sort = S_NONE;
param = evhttp_find_header(query, "sort");
if (param)
{
if (strcmp(param, "name") == 0)
qp->sort = S_NAME;
else if (strcmp(param, "album") == 0)
qp->sort = S_ALBUM;
else
DPRINTF(E_DBG, L_DAAP, "Unknown sort param: %s\n", param);
if (qp->sort != S_NONE)
DPRINTF(E_DBG, L_DAAP, "Sorting songlist by %s\n", param);
}
param = evhttp_find_header(query, "query");
if (!param)