optimize a bit adding playlists/directories to playlist

This commit is contained in:
Andrzej Rybczak
2012-08-14 17:15:18 +02:00
parent bab756c579
commit dad2bba13e
7 changed files with 65 additions and 57 deletions

View File

@@ -883,19 +883,19 @@ int MPD::Connection::AddSong(const Song &s, int pos)
return !s.Empty() ? (AddSong((!s.isFromDB() ? "file://" : "") + (s.Localized() ? locale_to_utf_cpy(s.GetFile()) : s.GetFile()), pos)) : -1;
}
void MPD::Connection::Add(const std::string &path)
bool MPD::Connection::Add(const std::string &path)
{
if (!itsConnection)
return;
return false;
if (!isCommandsListEnabled)
{
GoBusy();
mpd_run_add(itsConnection, path.c_str());
return mpd_run_add(itsConnection, path.c_str());
}
else
{
assert(!isIdle);
mpd_send_add(itsConnection, path.c_str());
return mpd_send_add(itsConnection, path.c_str());
}
}