aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-04 20:30:27 +0100
committerMax Kellermann <max@duempel.org>2009-01-13 23:09:03 +0100
commitd93477d1369e55d76476952f30463461e47af443 (patch)
treec982a00d730f67a511c26c0f908f6d4a1ea85409
parent9f21cb9dda22d0c589b41acfd04da1a1969d68da (diff)
downloadmpd-d93477d1369e55d76476952f30463461e47af443.tar.gz
mpd-d93477d1369e55d76476952f30463461e47af443.tar.xz
mpd-d93477d1369e55d76476952f30463461e47af443.zip
update: refresh stats when database update is finished
-rw-r--r--NEWS2
-rw-r--r--src/update.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 9a8ca1b2f..8d3a37f1c 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ MPD 0.14.1 - not yet released
- id3: strip leading and trailing whitespace from ID3 tags
* audio outputs:
- jack: allocate default port names (fixes a crash)
+* update:
+ - refresh stats after update
* log: automatically append newline
* fix setenv() conflict on Solaris
* configure.ac: check for pkg-config before using it
diff --git a/src/update.c b/src/update.c
index ae079b74c..10108f0a9 100644
--- a/src/update.c
+++ b/src/update.c
@@ -32,6 +32,8 @@
#include "update.h"
#include "idle.h"
#include "conf.h"
+#include "stats.h"
+#include "dbUtils.h"
#include <glib.h>
@@ -597,6 +599,9 @@ void reap_update_task(void)
spawn_update_task(path);
} else {
progress = UPDATE_PROGRESS_IDLE;
+
+ stats.numberOfSongs = countSongsIn(NULL);
+ stats.dbPlayTime = sumSongTimesIn(NULL);
}
}