From 52a0ea2dc54b98a36923dbe92671eec4c055b11f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 29 Sep 2008 12:15:16 +0200 Subject: directory: update playlist version if updated If we updated the mpd metadata database; then there's a chance some of those songs in the playlist will have updated metadata. So be on the safe side and increment the playlist version number if _any_ song changed (this is how all released versions of mpd did it, too). This bug was introduced recently when making "update" threaded. Thanks to stonecrest for the bug report. --- src/directory.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/directory.c') diff --git a/src/directory.c b/src/directory.c index 64d55e7e..31b1e9a8 100644 --- a/src/directory.c +++ b/src/directory.c @@ -123,9 +123,14 @@ int isUpdatingDB(void) void reap_update_task(void) { + enum update_return ret; + if (progress != UPDATE_PROGRESS_DONE) return; - pthread_join(update_thr, NULL); + if (pthread_join(update_thr, (void **)&ret)) + FATAL("error joining update thread: %s\n", strerror(errno)); + if (ret == UPDATE_RETURN_UPDATED) + playlistVersionChange(); progress = UPDATE_PROGRESS_IDLE; } -- cgit v1.2.3