Commit 8c5470a3 authored by Max Kellermann's avatar Max Kellermann

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.
parent 49ac6fa9
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment