From 266baf83ad8f6929b59e080dfbcdc392c2f33663 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 12 Jun 2009 19:40:08 +0200 Subject: [PATCH] mpdclient: tweak updatingdb in mpdclient.c The mpdclient library should care about setting the new (temporary) MPD update status. --- src/mpdclient.c | 12 +++++++++++- src/screen_file.c | 4 ---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/mpdclient.c b/src/mpdclient.c index 9aab2fc..cc391ab 100644 --- a/src/mpdclient.c +++ b/src/mpdclient.c @@ -412,8 +412,18 @@ mpdclient_cmd_crossfade(mpdclient_t *c, gint value) gint mpdclient_cmd_db_update(mpdclient_t *c, gchar *path) { + gint ret; + mpd_sendUpdateCommand(c->connection, path ? path : ""); - return mpdclient_finish_command(c); + ret = mpdclient_finish_command(c); + + if (ret == 0) + /* set updatingDb to make sure the browse callback + gets called even if the update has finished before + status is updated */ + c->status->updatingDb = 1; + + return ret; } gint diff --git a/src/screen_file.c b/src/screen_file.c index fdb8a5a..a149e91 100644 --- a/src/screen_file.c +++ b/src/screen_file.c @@ -272,10 +272,6 @@ browse_cmd(mpdclient_t *c, command_t cmd) g_free(path_locale); } else screen_status_printf(_("Database update started")); - - /* set updatingDb to make sure the browse callback gets called - * even if the updated has finished before status is updated */ - c->status->updatingDb = 1; } } else screen_status_printf(_("Database update running...")); -- 2.30.2