From: Max Kellermann Date: Wed, 17 Sep 2008 23:57:34 +0000 (+0200) Subject: playlist: reset id in playlist_clear() X-Git-Tag: v0.12_alpha1~246 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=97aa8b3d2af61beab67ca4882251ce68582b95b6;p=ncmpc.git playlist: reset id in playlist_clear() The playlist is reset when the connection to the MPD server is closed. After a successful reconnect, we have to reload the full playlist. To remember this, also reset the id attribute. --- diff --git a/src/playlist.c b/src/playlist.c index 76a448b..919b4c3 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -41,6 +41,8 @@ playlist_clear(struct mpdclient_playlist *playlist) { guint i; + playlist->id = 0; + for (i = 0; i < playlist->list->len; ++i) { struct mpd_song *song = playlist_get(playlist, i);