From 641e5462ccf1fa3375fd16010d6bb708b6cb3d38 Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Sun, 7 Mar 2010 11:53:16 +0100 Subject: [PATCH] Rename pl_id member of struct query_params --- src/db.c | 16 ++++++++-------- src/db.h | 2 +- src/httpd_daap.c | 2 +- src/httpd_rsp.c | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/db.c b/src/db.c index 259d4531..94f20631 100644 --- a/src/db.c +++ b/src/db.c @@ -583,10 +583,10 @@ db_build_query_plitems_plain(struct query_params *qp, char **q) if (qp->filter) count = sqlite3_mprintf("SELECT COUNT(*) FROM files JOIN playlistitems ON files.path = playlistitems.filepath" - " WHERE playlistitems.playlistid = %d AND files.disabled = 0 AND %s;", qp->pl_id, qp->filter); + " WHERE playlistitems.playlistid = %d AND files.disabled = 0 AND %s;", qp->id, qp->filter); else count = sqlite3_mprintf("SELECT COUNT(*) FROM files JOIN playlistitems ON files.path = playlistitems.filepath" - " WHERE playlistitems.playlistid = %d AND files.disabled = 0;", qp->pl_id); + " WHERE playlistitems.playlistid = %d AND files.disabled = 0;", qp->id); if (!count) { @@ -609,19 +609,19 @@ db_build_query_plitems_plain(struct query_params *qp, char **q) if (idx && qp->filter) query = sqlite3_mprintf("SELECT files.* FROM files JOIN playlistitems ON files.path = playlistitems.filepath" " WHERE playlistitems.playlistid = %d AND files.disabled = 0 AND %s ORDER BY playlistitems.id ASC %s;", - qp->pl_id, qp->filter, idx); + qp->id, qp->filter, idx); else if (idx) query = sqlite3_mprintf("SELECT files.* FROM files JOIN playlistitems ON files.path = playlistitems.filepath" " WHERE playlistitems.playlistid = %d AND files.disabled = 0 ORDER BY playlistitems.id ASC %s;", - qp->pl_id, idx); + qp->id, idx); else if (qp->filter) query = sqlite3_mprintf("SELECT files.* FROM files JOIN playlistitems ON files.path = playlistitems.filepath" " WHERE playlistitems.playlistid = %d AND files.disabled = 0 AND %s ORDER BY playlistitems.id ASC;", - qp->pl_id, qp->filter); + qp->id, qp->filter); else query = sqlite3_mprintf("SELECT files.* FROM files JOIN playlistitems ON files.path = playlistitems.filepath" " WHERE playlistitems.playlistid = %d AND files.disabled = 0 ORDER BY playlistitems.id ASC;", - qp->pl_id); + qp->id); if (!query) { @@ -688,13 +688,13 @@ db_build_query_plitems(struct query_params *qp, char **q) struct playlist_info *pli; int ret; - if (qp->pl_id <= 0) + if (qp->id <= 0) { DPRINTF(E_LOG, L_DB, "No playlist id specified in playlist items query\n"); return -1; } - pli = db_pl_fetch_byid(qp->pl_id); + pli = db_pl_fetch_byid(qp->id); if (!pli) return -1; diff --git a/src/db.h b/src/db.h index 244e7a94..0446e398 100644 --- a/src/db.h +++ b/src/db.h @@ -33,7 +33,7 @@ struct query_params { /* Query parameters, filled in by caller */ enum query_type type; enum index_type idx_type; - int pl_id; + int id; int offset; int limit; diff --git a/src/httpd_daap.c b/src/httpd_daap.c index 7c9302e4..8e704b50 100644 --- a/src/httpd_daap.c +++ b/src/httpd_daap.c @@ -1400,7 +1400,7 @@ daap_reply_songlist_generic(struct evhttp_request *req, struct evbuffer *evbuf, if (playlist != -1) { qp.type = Q_PLITEMS; - qp.pl_id = playlist; + qp.id = playlist; } else qp.type = Q_ITEMS; diff --git a/src/httpd_rsp.c b/src/httpd_rsp.c index c21476f5..e1b01119 100644 --- a/src/httpd_rsp.c +++ b/src/httpd_rsp.c @@ -459,14 +459,14 @@ rsp_reply_playlist(struct evhttp_request *req, char **uri, struct evkeyvalq *que memset(&qp, 0, sizeof(struct query_params)); - ret = safe_atoi32(uri[2], &qp.pl_id); + ret = safe_atoi32(uri[2], &qp.id); if (ret < 0) { rsp_send_error(req, "Invalid playlist ID"); return; } - if (qp.pl_id == 0) + if (qp.id == 0) qp.type = Q_ITEMS; else qp.type = Q_PLITEMS; @@ -663,7 +663,7 @@ rsp_reply_browse(struct evhttp_request *req, char **uri, struct evkeyvalq *query return; } - ret = safe_atoi32(uri[2], &qp.pl_id); + ret = safe_atoi32(uri[2], &qp.id); if (ret < 0) { rsp_send_error(req, "Invalid playlist ID");