add ('a') items to currently selected playlist in playlist editor
This commit is contained in:
@@ -875,8 +875,10 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else if (Keypressed(input, Key.Add))
|
else if (Keypressed(input, Key.Add))
|
||||||
{
|
{
|
||||||
|
if (myScreen == myPlaylistEditor && myPlaylistEditor->Playlists->Empty())
|
||||||
|
continue;
|
||||||
LockStatusbar();
|
LockStatusbar();
|
||||||
Statusbar() << "Add: ";
|
Statusbar() << (myScreen == myPlaylistEditor ? "Add to playlist: " : "Add: ");
|
||||||
string path = wFooter->GetString();
|
string path = wFooter->GetString();
|
||||||
UnlockStatusbar();
|
UnlockStatusbar();
|
||||||
if (!path.empty())
|
if (!path.empty())
|
||||||
@@ -887,12 +889,20 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
Mpd->StartCommandsList();
|
Mpd->StartCommandsList();
|
||||||
SongList::const_iterator it = list.begin();
|
SongList::const_iterator it = list.begin();
|
||||||
for (; it != list.end(); it++)
|
if (myScreen == myPlaylistEditor)
|
||||||
if (Mpd->AddSong(**it) < 0)
|
{
|
||||||
break;
|
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();
|
Mpd->CommitCommandsList();
|
||||||
|
|
||||||
if (it != list.begin())
|
if (it != list.begin() && myScreen != myPlaylistEditor)
|
||||||
{
|
{
|
||||||
Song &s = myPlaylist->Main()->at(myPlaylist->Main()->Size()-list.size());
|
Song &s = myPlaylist->Main()->at(myPlaylist->Main()->Size()-list.size());
|
||||||
if (s.GetHash() != list[0]->GetHash())
|
if (s.GetHash() != list[0]->GetHash())
|
||||||
@@ -900,7 +910,18 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Mpd->AddSong(path);
|
{
|
||||||
|
if (myScreen == myPlaylistEditor)
|
||||||
|
{
|
||||||
|
Mpd->AddToPlaylist(myPlaylistEditor->Playlists->Current(), path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Mpd->AddSong(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (myScreen == myPlaylistEditor)
|
||||||
|
myPlaylistEditor->Content->Clear(0); // make it refetch content of playlist
|
||||||
FreeSongList(list);
|
FreeSongList(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user