From 5dd58ea7a8c4a61555abeeb505e19ab212c2a8d9 Mon Sep 17 00:00:00 2001 From: Kai Elwert Date: Sun, 29 Aug 2010 10:31:26 +0200 Subject: [PATCH] Use DAAP collation for browse queries --- src/db.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/db.c b/src/db.c index 2eec4661..876eceb8 100644 --- a/src/db.c +++ b/src/db.c @@ -1053,10 +1053,10 @@ db_build_query_browse(struct query_params *qp, char *field, char **q) int ret; if (qp->filter) - count = sqlite3_mprintf("SELECT COUNT(DISTINCT %s COLLATE NOCASE) FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != '' AND %s;", + count = sqlite3_mprintf("SELECT COUNT(DISTINCT %s COLLATE DAAP) FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != '' AND %s;", field, field, qp->filter); else - count = sqlite3_mprintf("SELECT COUNT(DISTINCT %s COLLATE NOCASE) FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != '';", + count = sqlite3_mprintf("SELECT COUNT(DISTINCT %s COLLATE DAAP) FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != '';", field, field); if (!count) @@ -1078,16 +1078,16 @@ db_build_query_browse(struct query_params *qp, char *field, char **q) return -1; if (idx && qp->filter) - query = sqlite3_mprintf("SELECT DISTINCT %s COLLATE NOCASE FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != ''" + query = sqlite3_mprintf("SELECT DISTINCT %s COLLATE DAAP FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != ''" " AND %s %s;", field, field, qp->filter, idx); else if (idx) - query = sqlite3_mprintf("SELECT DISTINCT %s COLLATE NOCASE FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != ''" + query = sqlite3_mprintf("SELECT DISTINCT %s COLLATE DAAP FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != ''" " %s;", field, field, idx); else if (qp->filter) - query = sqlite3_mprintf("SELECT DISTINCT %s COLLATE NOCASE FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != ''" + query = sqlite3_mprintf("SELECT DISTINCT %s COLLATE DAAP FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != ''" " AND %s;", field, field, qp->filter); else - query = sqlite3_mprintf("SELECT DISTINCT %s COLLATE NOCASE FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != ''", + query = sqlite3_mprintf("SELECT DISTINCT %s COLLATE DAAP FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != ''", field, field); if (!query)