browser: make playing newly loaded playlist work in all cases
This commit is contained in:
@@ -139,23 +139,18 @@ void Browser::EnterPressed()
|
|||||||
}
|
}
|
||||||
case itPlaylist:
|
case itPlaylist:
|
||||||
{
|
{
|
||||||
if (itsBrowsedDir == "/")
|
std::string name = item.name;
|
||||||
{
|
ShowMessage("Loading and playing playlist %s...", name.c_str());
|
||||||
MPD::SongList list;
|
locale_to_utf(name);
|
||||||
Mpd.GetPlaylistContent(locale_to_utf_cpy(item.name), list);
|
if (!Mpd.LoadPlaylist(name))
|
||||||
if (myPlaylist->Add(list, 1))
|
ShowMessage("Couldn't load playlist.");
|
||||||
ShowMessage("Loading and playing playlist %s...", item.name.c_str());
|
|
||||||
FreeSongList(list);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::string name = item.name;
|
size_t old_size = myPlaylist->Items->Size();
|
||||||
ShowMessage("Loading playlist %s...", name.c_str());
|
Mpd.UpdateStatus();
|
||||||
locale_to_utf(name);
|
if (old_size < myPlaylist->Items->Size())
|
||||||
if (!Mpd.LoadPlaylist(name))
|
Mpd.Play(old_size);
|
||||||
ShowMessage("Couldn't load playlist.");
|
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user