playlist/Print: don't skip non-existent songs in "listplaylist"

Skipping those songs silently will confuse the client, because
commands specifying the song index within a playlist
(e.g. playlistdelete) will be out of sync.

This copies spl_print()'s behavior to playlist_file_print().
This commit is contained in:
Max Kellermann 2014-12-09 13:36:48 +01:00
parent 8904127c10
commit 0cfd4fff62
2 changed files with 9 additions and 6 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.19.7 (not yet released)
* playlist
- don't skip non-existent songs in "listplaylist"
ver 0.19.6 (2014/12/08)
* decoder

View File

@ -43,12 +43,13 @@ playlist_provider_print(Client &client, const char *uri,
DetachedSong *song;
while ((song = e.NextSong()) != nullptr) {
if (playlist_check_translate_song(*song, base_uri.c_str(),
loader)) {
if (detail)
song_print_info(client, *song);
else
song_print_uri(client, *song);
}
loader) &&
detail)
song_print_info(client, *song);
else
/* fallback if no detail was requested or no
detail was available */
song_print_uri(client, *song);
delete song;
}