mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-27 06:33:21 -05:00
Rename count_info to fix issue #157
This commit is contained in:
parent
8dd1e0fde2
commit
a1e417c571
8
src/db.c
8
src/db.c
@ -1801,11 +1801,11 @@ db_query_fetch_group(struct query_params *qp, struct db_group_info *dbgri)
|
||||
}
|
||||
|
||||
int
|
||||
db_query_fetch_count(struct query_params *qp, struct count_info *ci)
|
||||
db_query_fetch_count(struct query_params *qp, struct filecount_info *fci)
|
||||
{
|
||||
int ret;
|
||||
|
||||
memset(ci, 0, sizeof(struct count_info));
|
||||
memset(fci, 0, sizeof(struct filecount_info));
|
||||
|
||||
if (!qp->stmt)
|
||||
{
|
||||
@ -1831,8 +1831,8 @@ db_query_fetch_count(struct query_params *qp, struct count_info *ci)
|
||||
return -1;
|
||||
}
|
||||
|
||||
ci->count = sqlite3_column_int(qp->stmt, 0);
|
||||
ci->length = sqlite3_column_int(qp->stmt, 1);
|
||||
fci->count = sqlite3_column_int(qp->stmt, 0);
|
||||
fci->length = sqlite3_column_int(qp->stmt, 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
4
src/db.h
4
src/db.h
@ -345,7 +345,7 @@ struct watch_enum {
|
||||
sqlite3_stmt *stmt;
|
||||
};
|
||||
|
||||
struct count_info {
|
||||
struct filecount_info {
|
||||
uint32_t count;
|
||||
uint32_t length;
|
||||
};
|
||||
@ -402,7 +402,7 @@ int
|
||||
db_query_fetch_group(struct query_params *qp, struct db_group_info *dbgri);
|
||||
|
||||
int
|
||||
db_query_fetch_count(struct query_params *qp, struct count_info *ci);
|
||||
db_query_fetch_count(struct query_params *qp, struct filecount_info *fci);
|
||||
|
||||
int
|
||||
db_query_fetch_string(struct query_params *qp, char **string);
|
||||
|
@ -2185,7 +2185,7 @@ static int
|
||||
mpd_command_count(struct evbuffer *evbuf, int argc, char **argv, char **errmsg)
|
||||
{
|
||||
struct query_params qp;
|
||||
struct count_info ci;
|
||||
struct filecount_info fci;
|
||||
int ret;
|
||||
|
||||
if (argc < 3 || ((argc - 1) % 2) != 0)
|
||||
@ -2213,7 +2213,7 @@ mpd_command_count(struct evbuffer *evbuf, int argc, char **argv, char **errmsg)
|
||||
return ACK_ERROR_UNKNOWN;
|
||||
}
|
||||
|
||||
ret = db_query_fetch_count(&qp, &ci);
|
||||
ret = db_query_fetch_count(&qp, &fci);
|
||||
if (ret < 0)
|
||||
{
|
||||
db_query_end(&qp);
|
||||
@ -2227,8 +2227,8 @@ mpd_command_count(struct evbuffer *evbuf, int argc, char **argv, char **errmsg)
|
||||
evbuffer_add_printf(evbuf,
|
||||
"songs: %d\n"
|
||||
"playtime: %d\n",
|
||||
ci.count,
|
||||
(ci.length / 1000));
|
||||
fci.count,
|
||||
(fci.length / 1000));
|
||||
|
||||
db_query_end(&qp);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user