aboutsummaryrefslogtreecommitdiffstats
path: root/src/stats.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-04 20:57:06 +0100
committerMax Kellermann <max@duempel.org>2009-01-04 20:57:06 +0100
commit6acba7350938c099afab7bec04c8dc9adf674424 (patch)
treeac24517eff8723561eacea3921d971bfd4e257c2 /src/stats.c
parent5c477f6067660a448a49622f466c23eab862e372 (diff)
downloadmpd-6acba7350938c099afab7bec04c8dc9adf674424.tar.gz
mpd-6acba7350938c099afab7bec04c8dc9adf674424.tar.xz
mpd-6acba7350938c099afab7bec04c8dc9adf674424.zip
stats: added stats_update()
Diffstat (limited to 'src/stats.c')
-rw-r--r--src/stats.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/stats.c b/src/stats.c
index 53c785614..dd56f754b 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -24,6 +24,7 @@
#include "client.h"
#include "player_control.h"
#include "strset.h"
+#include "dbUtils.h"
Stats stats;
@@ -33,6 +34,12 @@ void initStats(void)
stats.numberOfSongs = 0;
}
+void stats_update(void)
+{
+ stats.numberOfSongs = countSongsIn(NULL);
+ stats.dbPlayTime = sumSongTimesIn(NULL);
+}
+
struct visit_data {
enum tag_type type;
struct strset *set;