Code

mpdclient: set all idle events on disconnect
authorMax Kellermann <max@duempel.org>
Sat, 10 Oct 2009 13:47:43 +0000 (15:47 +0200)
committerMax Kellermann <max@duempel.org>
Sat, 10 Oct 2009 13:47:43 +0000 (15:47 +0200)
After a disconnect, all subsystems have to consider the "new data"
(i.e. nothing).

src/mpdclient.c
src/screen.c

index a96deaddf73dd8fab691f937e37960153dd7d03f..d000df102cce3341de40b1b911e036766b8c0bc2 100644 (file)
@@ -134,6 +134,11 @@ mpdclient_disconnect(struct mpdclient *c)
 
        if (c->song)
                c->song = NULL;
+
+       /* everything has changed after a disconnect */
+       c->idle |= MPD_IDLE_DATABASE|MPD_IDLE_STORED_PLAYLIST|
+               MPD_IDLE_QUEUE|MPD_IDLE_PLAYER|MPD_IDLE_MIXER|MPD_IDLE_OUTPUT|
+               MPD_IDLE_OPTIONS|MPD_IDLE_UPDATE;
 }
 
 bool
index c01c79232571d2de8c37ad2492ef5d810e6382cc..58cc492edd69c7b223047cb5947a207cdfa0c34b 100644 (file)
@@ -426,7 +426,8 @@ screen_update(struct mpdclient *c)
                crossfade = mpd_status_get_crossfade(c->status);
        }
 
-       if ((c->events & MPD_IDLE_DATABASE) != 0 && was_connected)
+       if ((c->events & MPD_IDLE_DATABASE) != 0 && was_connected &&
+           mpdclient_is_connected(c))
                screen_status_printf(_("Database updated"));
        was_connected = mpdclient_is_connected(c);