From 8c5470a3db7f36cc50b8f5591c8b1f1410977581 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Jan 2009 18:59:32 +0100 Subject: playlist: log errors during loadPlaylist() Don't call command_error() if loading a song from the playlist fails. This may result in assertion failures, since command_error() may be called more than once. --- src/command.c | 2 +- src/playlist.c | 5 ++--- src/playlist.h | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/command.c b/src/command.c index 19aeaba32..8fb20a5d6 100644 --- a/src/command.c +++ b/src/command.c @@ -591,7 +591,7 @@ handle_load(struct client *client, G_GNUC_UNUSED int argc, char *argv[]) { enum playlist_result result; - result = loadPlaylist(client, argv[1]); + result = loadPlaylist(argv[1]); return print_playlist_result(client, result); } diff --git a/src/playlist.c b/src/playlist.c index f62e67db2..414e5a63a 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -1333,7 +1333,7 @@ int PlaylistInfo(struct client *client, const char *utf8file, int detail) return 0; } -enum playlist_result loadPlaylist(struct client *client, const char *utf8file) +enum playlist_result loadPlaylist(const char *utf8file) { GPtrArray *list; @@ -1352,8 +1352,7 @@ enum playlist_result loadPlaylist(struct client *client, const char *utf8file) p++; } if ((addToPlaylist(temp, NULL)) != PLAYLIST_RESULT_SUCCESS) { - command_error(client, ACK_ERROR_PLAYLIST_LOAD, - "can't add file \"%s\"", temp2); + g_warning("can't add file \"%s\"", temp2); } free(temp2); } diff --git a/src/playlist.h b/src/playlist.h index a4b40f6e0..59c37a788 100644 --- a/src/playlist.h +++ b/src/playlist.h @@ -126,7 +126,7 @@ enum playlist_result swapSongsInPlaylist(unsigned song1, unsigned song2); enum playlist_result swapSongsInPlaylistById(unsigned id1, unsigned id2); -enum playlist_result loadPlaylist(struct client *client, const char *utf8file); +enum playlist_result loadPlaylist(const char *utf8file); bool getPlaylistRepeatStatus(void); -- cgit v1.2.3