[db] Refactor fetching query result into generic function

Additionally changes the return value in case the end of the result set
is reached.
This commit is contained in:
chme
2021-12-28 06:55:35 +01:00
parent d7086cab00
commit a65ee4462e
9 changed files with 59 additions and 113 deletions

View File

@@ -588,7 +588,7 @@ rsp_reply_playlist(struct httpd_request *hreq)
mxmlNewTextf(node, 0, "%d", qp.results);
/* Items block (all items) */
while (((ret = db_query_fetch_file(&qp, &dbmfi)) == 0) && (dbmfi.id))
while ((ret = db_query_fetch_file(&qp, &dbmfi)) == 0)
{
headers = evhttp_request_get_input_headers(hreq->req);