mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-14 08:15:02 -05:00
[db] Fix count error in db_build_query_browse() if no items match query
This commit is contained in:
parent
aa3aa383ef
commit
b54c9ff1c6
2
src/db.c
2
src/db.c
@ -1819,7 +1819,7 @@ db_build_query_browse(struct query_params *qp)
|
||||
select = browse_clause[qp->type & ~Q_F_BROWSE].select;
|
||||
where = browse_clause[qp->type & ~Q_F_BROWSE].where;
|
||||
|
||||
count = sqlite3_mprintf("SELECT COUNT(*) FROM files f %s AND %s != '' %s;", qc->where, where, qc->group);
|
||||
count = sqlite3_mprintf("SELECT COUNT(*) FROM (SELECT %s FROM files f %s AND %s != '' %s);", select, qc->where, where, qc->group);
|
||||
query = sqlite3_mprintf("SELECT %s FROM files f %s AND %s != '' %s %s %s;", select, qc->where, where, qc->group, qc->order, qc->index);
|
||||
|
||||
db_free_query_clause(qc);
|
||||
|
Loading…
Reference in New Issue
Block a user