From ca72ee59266acee707f68514572b067ea870b06b Mon Sep 17 00:00:00 2001 From: Kai Elwert Date: Tue, 3 Aug 2010 23:28:46 +0200 Subject: [PATCH] Handle sort parameter in DAAP queries This is used by Remote for the Title view. --- src/httpd_daap.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) mode change 100644 => 100755 src/httpd_daap.c diff --git a/src/httpd_daap.c b/src/httpd_daap.c old mode 100644 new mode 100755 index 531ffe8a..fdd8e92e --- a/src/httpd_daap.c +++ b/src/httpd_daap.c @@ -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)