[mpd] Fix wrong db playime info in 'stats' command (#360)

This commit is contained in:
chme 2017-03-04 17:23:52 +01:00 committed by ejurgensen
parent 62cb07c73b
commit 1dde41fb87
3 changed files with 4 additions and 4 deletions

View File

@ -1677,7 +1677,7 @@ db_query_fetch_count(struct query_params *qp, struct filecount_info *fci)
}
fci->count = sqlite3_column_int(qp->stmt, 0);
fci->length = sqlite3_column_int(qp->stmt, 1);
fci->length = sqlite3_column_int64(qp->stmt, 1);
return 0;
}

View File

@ -350,7 +350,7 @@ struct watch_enum {
struct filecount_info {
uint32_t count;
uint32_t length;
uint64_t length;
};
/* Directory ids must be in sync with the ids in Q_DIR* in db_init.c */

View File

@ -821,7 +821,7 @@ mpd_command_stats(struct evbuffer *evbuf, int argc, char **argv, char **errmsg)
"albums: %d\n"
"songs: %d\n"
"uptime: %d\n" //in seceonds
"db_playtime: %d\n"
"db_playtime: %" PRIu64 "\n"
"db_update: %d\n"
"playtime: %d\n",
artists,
@ -2470,7 +2470,7 @@ mpd_command_count(struct evbuffer *evbuf, int argc, char **argv, char **errmsg)
evbuffer_add_printf(evbuf,
"songs: %d\n"
"playtime: %d\n",
"playtime: %" PRIu64 "\n",
fci.count,
(fci.length / 1000));