|
|
|
@ -147,13 +147,23 @@ void PlaylistEditor::update() |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_playlists_update_requested = false; |
|
|
|
m_playlists_update_requested = false; |
|
|
|
size_t idx = 0; |
|
|
|
size_t idx = 0; |
|
|
|
for (MPD::PlaylistIterator it = Mpd.GetPlaylists(), end; it != end; ++it, ++idx) |
|
|
|
try |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (idx < Playlists.size()) |
|
|
|
for (MPD::PlaylistIterator it = Mpd.GetPlaylists(), end; it != end; ++it, ++idx) |
|
|
|
Playlists[idx].value() = std::move(*it); |
|
|
|
{ |
|
|
|
|
|
|
|
if (idx < Playlists.size()) |
|
|
|
|
|
|
|
Playlists[idx].value() = std::move(*it); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
Playlists.addItem(std::move(*it)); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch (MPD::ServerError &e) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (e.code() == MPD_SERVER_ERROR_SYSTEM) // no playlists directory
|
|
|
|
|
|
|
|
Statusbar::print(e.what()); |
|
|
|
else |
|
|
|
else |
|
|
|
Playlists.addItem(std::move(*it)); |
|
|
|
throw; |
|
|
|
}; |
|
|
|
} |
|
|
|
if (idx < Playlists.size()) |
|
|
|
if (idx < Playlists.size()) |
|
|
|
Playlists.resizeList(idx); |
|
|
|
Playlists.resizeList(idx); |
|
|
|
std::sort(Playlists.beginV(), Playlists.endV(), |
|
|
|
std::sort(Playlists.beginV(), Playlists.endV(), |
|
|
|
|