remove duplicated (and by the way quite broken) code
This commit is contained in:
@@ -1064,39 +1064,13 @@ int main(int argc, char *argv[])
|
|||||||
SongList list;
|
SongList list;
|
||||||
Mpd.GetDirectoryRecursive(path, list);
|
Mpd.GetDirectoryRecursive(path, list);
|
||||||
if (!list.empty())
|
if (!list.empty())
|
||||||
{
|
myPlaylist->Add(list, 0);
|
||||||
Mpd.StartCommandsList();
|
|
||||||
SongList::const_iterator it = list.begin();
|
|
||||||
if (myScreen == myPlaylistEditor)
|
|
||||||
{
|
|
||||||
for (; it != list.end(); ++it)
|
|
||||||
Mpd.AddToPlaylist(myPlaylistEditor->Playlists->Current(), **it);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (; it != list.end(); ++it)
|
|
||||||
if (Mpd.AddSong(**it) < 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
Mpd.CommitCommandsList();
|
|
||||||
|
|
||||||
if (it != list.begin() && myScreen != myPlaylistEditor)
|
|
||||||
{
|
|
||||||
Song &s = myPlaylist->Main()->at(myPlaylist->Main()->Size()-list.size());
|
|
||||||
if (s.GetHash() != list[0]->GetHash())
|
|
||||||
ShowMessage("%s", MPD::Message::PartOfSongsAdded);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (myScreen == myPlaylistEditor)
|
if (myScreen == myPlaylistEditor)
|
||||||
{
|
|
||||||
Mpd.AddToPlaylist(myPlaylistEditor->Playlists->Current(), path);
|
Mpd.AddToPlaylist(myPlaylistEditor->Playlists->Current(), path);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
Mpd.AddSong(path);
|
Mpd.AddSong(path);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (myScreen == myPlaylistEditor)
|
if (myScreen == myPlaylistEditor)
|
||||||
myPlaylistEditor->Content->Clear(0); // make it refetch content of playlist
|
myPlaylistEditor->Content->Clear(0); // make it refetch content of playlist
|
||||||
|
|||||||
Reference in New Issue
Block a user