mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-28 15:06:02 -05:00
db_build_query_browse() query changes ("DISTINCT %s, %s", field, field)
This commit is contained in:
parent
bf86cf45bd
commit
d8bf5eedce
16
src/db.c
16
src/db.c
@ -1100,17 +1100,17 @@ db_build_query_browse(struct query_params *qp, char *field, char **q)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (idx && qp->filter)
|
if (idx && qp->filter)
|
||||||
query = sqlite3_mprintf("SELECT DISTINCT %s COLLATE DAAP FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != ''"
|
query = sqlite3_mprintf("SELECT DISTINCT %s COLLATE DAAP, %s FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != ''"
|
||||||
" AND %s %s;", field, field, qp->filter, idx);
|
" AND %s %s;", field, field, field, qp->filter, idx);
|
||||||
else if (idx)
|
else if (idx)
|
||||||
query = sqlite3_mprintf("SELECT DISTINCT %s COLLATE DAAP FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != ''"
|
query = sqlite3_mprintf("SELECT DISTINCT %s COLLATE DAAP, %s FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != ''"
|
||||||
" %s;", field, field, idx);
|
" %s;", field, field, field, idx);
|
||||||
else if (qp->filter)
|
else if (qp->filter)
|
||||||
query = sqlite3_mprintf("SELECT DISTINCT %s COLLATE DAAP FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != ''"
|
query = sqlite3_mprintf("SELECT DISTINCT %s COLLATE DAAP, %s FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != ''"
|
||||||
" AND %s;", field, field, qp->filter);
|
" AND %s;", field, field, field, qp->filter);
|
||||||
else
|
else
|
||||||
query = sqlite3_mprintf("SELECT DISTINCT %s COLLATE DAAP FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != ''",
|
query = sqlite3_mprintf("SELECT DISTINCT %s COLLATE DAAP, %s FROM files WHERE data_kind = 0 AND disabled = 0 AND %s != ''",
|
||||||
field, field);
|
field, field, field);
|
||||||
|
|
||||||
if (!query)
|
if (!query)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user