From a0537b5e5433b32ed6fa25ad22490924bafcbbd8 Mon Sep 17 00:00:00 2001 From: Qball Cow Date: Sun, 8 Feb 2009 14:57:11 +0100 Subject: [PATCH] Force stats update when getting database event, now unfucked (again) --- src/libmpd-status.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libmpd-status.c b/src/libmpd-status.c index 3877da4..bf21960 100644 --- a/src/libmpd-status.c +++ b/src/libmpd-status.c @@ -271,6 +271,7 @@ int mpd_status_update(MpdObj *mi) } }else { char *name; + int update_stats = 0; mpd_sendGetEventsCommand(mi->connection); while((name = mpd_getNextEvent(mi->connection))){ if(strcmp(name, "output") == 0){ @@ -278,7 +279,7 @@ int mpd_status_update(MpdObj *mi) }else if (strcmp(name, "database") == 0) { if((what_changed&MPD_CST_DATABASE) == 0) { - mpd_stats_update_real(mi, &what_changed); + update_stats = 1; } what_changed |= MPD_CST_DATABASE; }else if (strcmp(name, "stored_playlist")==0) { @@ -291,6 +292,9 @@ int mpd_status_update(MpdObj *mi) free(name); } mpd_finishCommand(mi->connection); + if(update_stats) { + mpd_stats_update_real(mi, &what_changed); + } } -- 2.11.4.GIT