From 225e70a38b68cba219aeb7cb239f426ca739ed7d Mon Sep 17 00:00:00 2001 From: Kalle Wallin Date: Sat, 5 Jun 2004 12:56:56 +0000 Subject: Addded support for the mpd update command (CMD_DB_UPDATE) git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1343 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/screen.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/screen.c') diff --git a/src/screen.c b/src/screen.c index d846f3df5..4059ac24f 100644 --- a/src/screen.c +++ b/src/screen.c @@ -708,7 +708,7 @@ screen_idle(mpd_client_t *c) void screen_cmd(mpd_client_t *c, command_t cmd) { - int n; + int n = 0; screen_mode_t new_mode = screen->mode; screen->input_timestamp = time(NULL); @@ -801,6 +801,18 @@ screen_cmd(mpd_client_t *c, command_t cmd) mpd_sendCrossfadeCommand(c->connection, n); mpd_finishCommand(c->connection); break; + case CMD_DB_UPDATE: + if( !c->status->updatingDb ) + { + mpd_sendUpdateCommand(c->connection); + n = mpd_getUpdateId(c->connection); + mpd_finishCommand(c->connection); + if( !mpc_error(c) ) + screen_status_printf("Database update started [%d]", n); + } + else + screen_status_printf("Database update running..."); + break; case CMD_VOLUME_UP: if( c->status->volume!=MPD_STATUS_NO_VOLUME && c->status->volume<100 ) { -- cgit v1.2.3