simplify code responsible for adding items with 'a' more

This commit is contained in:
Andrzej Rybczak
2009-08-25 02:47:05 +02:00
parent 68b724d9de
commit 7a85a15ff2
3 changed files with 15 additions and 12 deletions

View File

@@ -563,6 +563,14 @@ int Connection::AddSong(const Song &s)
return !s.Empty() ? (AddSong((!s.isFromDB() ? "file://" : "") + (s.Localized() ? locale_to_utf_cpy(s.GetFile()) : s.GetFile()))) : -1;
}
void Connection::Add(const std::string &path) const
{
if (!isConnected)
return;
mpd_sendAddCommand(itsConnection, path.c_str());
mpd_finishCommand(itsConnection);
}
bool Connection::AddRandomSongs(size_t number)
{
if (!isConnected && !number)