From f8e586402d2b3c70fa0f28fc3ad6e542128e5562 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 22 Oct 2008 19:16:35 +0200 Subject: command: added print_spl_list() The function print_spl_list() replaces the old function lsPlaylists() from ls.c. --- src/command.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/command.c') diff --git a/src/command.c b/src/command.c index c1f0b3f3d..dbdbe4003 100644 --- a/src/command.c +++ b/src/command.c @@ -202,6 +202,17 @@ static int print_playlist_result(struct client *client, return -1; } +static void +print_spl_list(struct client *client, GPtrArray *list) +{ + for (unsigned i = 0; i < list->len; ++i) { + struct stored_playlist_info *playlist = + g_ptr_array_index(list, i); + + client_printf(client, "playlist: %s\n", playlist->name); + } +} + static int handleUrlHandlers(struct client *client, mpd_unused int argc, mpd_unused char *argv[]) { @@ -524,8 +535,13 @@ static int handleLsInfo(struct client *client, directory_print(client, directory); - if (isRootDirectory(path)) - return lsPlaylists(client, path); + if (isRootDirectory(path)) { + GPtrArray *list = spl_list(); + if (list != NULL) { + print_spl_list(client, list); + spl_list_free(list); + } + } return 0; } -- cgit v1.2.3