mpd: make GetRecursiveDirectory return SongIterator

This commit is contained in:
Andrzej Rybczak
2014-11-02 23:08:21 +01:00
parent afa8a34340
commit e5b0c7a357
5 changed files with 44 additions and 33 deletions

View File

@@ -447,17 +447,20 @@ void SearchEngine::Search()
MPD::SongList list;
if (Config.search_in_db)
{
MPD::ItemIterator item = Mpd.GetDirectoryRecursive("/"), end;
for (; item != end; ++item)
if (item->type() != MPD::Item::Type::Song)
list.push_back(std::move(item->song()));
std::copy(
std::make_move_iterator(Mpd.GetDirectoryRecursive("/")),
std::make_move_iterator(MPD::SongIterator()),
std::back_inserter(list)
);
}
else
{
std::copy(
myPlaylist->main().beginV(),
myPlaylist->main().endV(),
std::back_inserter(list)
);
}
bool any_found = 1;
bool found = 1;