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)
master
Matthew Hague 12 years ago committed by Andrzej Rybczak
parent 8913c77786
commit 67550d4607
  1. 6
      src/mpdpp.cpp

@ -718,8 +718,10 @@ void Connection::GetDirectoryRecursive(const std::string &directory, SongConsume
{ {
prechecksNoCommandsList(); prechecksNoCommandsList();
mpd_send_list_all_meta(m_connection, directory.c_str()); mpd_send_list_all_meta(m_connection, directory.c_str());
while (mpd_song *s = mpd_recv_song(m_connection)) while (mpd_entity *e = mpd_recv_entity(m_connection)) {
f(Song(s)); 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); mpd_response_finish(m_connection);
checkErrors(); checkErrors();
} }

Loading…
Cancel
Save