aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-11-21 23:30:49 +0100
committerMax Kellermann <max@duempel.org>2013-11-22 00:19:28 +0100
commitff1c1107f3a7ad0cfbdfefbe26f2f5e1cb9b00c5 (patch)
treefb8d096f20ac236611c8569e9009da78e8f9954a
parent41a3fd0fd06dd9d99b77982eac9b91aca9a768d0 (diff)
downloadmpd-ff1c1107f3a7ad0cfbdfefbe26f2f5e1cb9b00c5.tar.gz
mpd-ff1c1107f3a7ad0cfbdfefbe26f2f5e1cb9b00c5.tar.xz
mpd-ff1c1107f3a7ad0cfbdfefbe26f2f5e1cb9b00c5.zip
Stats: auto-reload statistics with proxy plugin
-rw-r--r--NEWS2
-rw-r--r--src/Stats.cxx7
2 files changed, 9 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 8a433e202..34867b245 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
ver 0.18.5 (20??/??/??)
* configuration
- fix crash when db_file is configured without music_directory
+* database
+ - proxy: auto-reload statistics
* decoder
- fluidsynth: auto-detect by default
* fix ia64, mipsel and other little-endian architectures
diff --git a/src/Stats.cxx b/src/Stats.cxx
index 2baeafa39..8f9d90b0f 100644
--- a/src/Stats.cxx
+++ b/src/Stats.cxx
@@ -62,6 +62,13 @@ void stats_update(void)
void
stats_print(Client &client)
{
+ if (!db_is_simple())
+ /* reload statistics if we're using the "proxy"
+ database plugin */
+ /* TODO: move this into the "proxy" database plugin as
+ an "idle" handler */
+ stats_update();
+
client_printf(client,
"artists: %u\n"
"albums: %u\n"