From 67550d4607634f933915d7d8fd523ad92dbd4af5 Mon Sep 17 00:00:00 2001 From: Matthew Hague Date: Wed, 28 May 2014 22:25:32 +0100 Subject: [PATCH] mpd: fix fetching mtime in getDirectoryRecursive getdirectoryrecursive was using mpd_recv_song after a listall including directories, changed to use mpd_recv_entity instead (else incorrect mtime reported) --- src/mpdpp.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mpdpp.cpp b/src/mpdpp.cpp index 671263c5..bb3dcfd6 100644 --- a/src/mpdpp.cpp +++ b/src/mpdpp.cpp @@ -718,8 +718,10 @@ void Connection::GetDirectoryRecursive(const std::string &directory, SongConsume { prechecksNoCommandsList(); mpd_send_list_all_meta(m_connection, directory.c_str()); - while (mpd_song *s = mpd_recv_song(m_connection)) - f(Song(s)); + while (mpd_entity *e = mpd_recv_entity(m_connection)) { + if (mpd_entity_get_type(e) == MPD_ENTITY_TYPE_SONG) + f(Song(mpd_song_dup(mpd_entity_get_song(e)))); + } mpd_response_finish(m_connection); checkErrors(); }