From 475d5db573a6eab1940c0b064a06854c9bb5f46b Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Tue, 5 May 2015 21:46:56 +0200 Subject: [PATCH] When a playlist request contains a query make the default sort S_ALBUM, which should keep audiobooks organized better and be in line with iTunes. This should fix #91, and I cross my fingers it does not have other unintended consequences. --- src/httpd_daap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/httpd_daap.c b/src/httpd_daap.c index bcef3aaa..08a27e14 100644 --- a/src/httpd_daap.c +++ b/src/httpd_daap.c @@ -687,6 +687,10 @@ get_query_params(struct evkeyvalq *query, int *sort_headers, struct query_params qp->filter = daap_query_parse_sql(param); if (!qp->filter) DPRINTF(E_LOG, L_DAAP, "Ignoring improper DAAP query: %s\n", param); + + /* iTunes seems to default to this when there is a query (which there is for audiobooks, but not for normal playlists) */ + if (qp->sort == S_NONE) + qp->sort = S_ALBUM; } }