From 3be8afac7b57d5d4726c6150b3c8451d13efdcbe Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Sun, 10 Apr 2016 00:11:33 +0200 Subject: [PATCH] [daap] Fix problem where playlists in Remote are not in correct order Apparantly having "LIMIT -1 OFFSET 0" makes (certain versions?) of sqlite3 unable to do the "ORDER BY". Might be a bug in sqlite. This is only a partial fix, which will work for queries that don't actually use an index. Those few that do may still be broken. --- src/httpd_daap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/httpd_daap.c b/src/httpd_daap.c index 60c8dc61..5f2b0dc9 100644 --- a/src/httpd_daap.c +++ b/src/httpd_daap.c @@ -638,7 +638,10 @@ get_query_params(struct evkeyvalq *query, int *sort_headers, struct query_params else qp->limit = (high - low) + 1; - qp->idx_type = I_SUB; + if (qp->limit == -1 && qp->offset == 0) + qp->idx_type = I_NONE; + else + qp->idx_type = I_SUB; qp->sort = S_NONE; param = evhttp_find_header(query, "sort");