diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-09-28 19:02:27 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-09-28 19:02:27 -0700 |
commit | d645f0a97a52ac061d1f6a43b798c05df93fc48e (patch) | |
tree | ea811b2c7ac230c61e3b8def8cce192e0361a441 | |
parent | 54df40c5f96eb8fe80b50dd8a85e8045c7dac9d4 (diff) | |
download | mpd-d645f0a97a52ac061d1f6a43b798c05df93fc48e.tar.gz mpd-d645f0a97a52ac061d1f6a43b798c05df93fc48e.tar.xz mpd-d645f0a97a52ac061d1f6a43b798c05df93fc48e.zip |
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.
-rw-r--r-- | src/directory.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/directory.c b/src/directory.c index ca6ef8666..f7c426267 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; } |