aboutsummaryrefslogtreecommitdiffstats
path: root/src/Stats.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-11-22 00:12:12 +0100
committerMax Kellermann <max@duempel.org>2013-11-22 00:12:12 +0100
commit41a3fd0fd06dd9d99b77982eac9b91aca9a768d0 (patch)
treec0aa4a0bb3bfb663af1708395b095fb98bca89d0 /src/Stats.cxx
parentb9169a5670c4cb603b25f0b07e93d9739c5b06f8 (diff)
downloadmpd-41a3fd0fd06dd9d99b77982eac9b91aca9a768d0.tar.gz
mpd-41a3fd0fd06dd9d99b77982eac9b91aca9a768d0.tar.xz
mpd-41a3fd0fd06dd9d99b77982eac9b91aca9a768d0.zip
Stats: use struct DatabaseStats
Eliminate redundant declaration.
Diffstat (limited to 'src/Stats.cxx')
-rw-r--r--src/Stats.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/Stats.cxx b/src/Stats.cxx
index 63be2a7bc..2baeafa39 100644
--- a/src/Stats.cxx
+++ b/src/Stats.cxx
@@ -31,7 +31,7 @@
#include <glib.h>
static GTimer *uptime;
-static struct stats stats;
+static DatabaseStats stats;
void stats_global_init(void)
{
@@ -51,17 +51,11 @@ void stats_update(void)
const DatabaseSelection selection("", true);
if (GetDatabase()->GetStats(selection, stats2, error)) {
- stats.song_count = stats2.song_count;
- stats.song_duration = stats2.total_duration;
- stats.artist_count = stats2.artist_count;
- stats.album_count = stats2.album_count;
+ stats = stats2;
} else {
LogError(error);
- stats.song_count = 0;
- stats.song_duration = 0;
- stats.artist_count = 0;
- stats.album_count = 0;
+ stats.Clear();
}
}
@@ -80,7 +74,7 @@ stats_print(Client &client)
stats.song_count,
(long)g_timer_elapsed(uptime, NULL),
(long)(client.player_control.GetTotalPlayTime() + 0.5),
- stats.song_duration);
+ stats.total_duration);
if (db_is_simple())
client_printf(client,