mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-28 16:15:57 -05:00
[mpd] Fix wrong db playime info in 'stats' command (#360)
This commit is contained in:
parent
62cb07c73b
commit
1dde41fb87
2
src/db.c
2
src/db.c
@ -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;
|
||||
}
|
||||
|
2
src/db.h
2
src/db.h
@ -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 */
|
||||
|
@ -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));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user