From 73e98c387134d44aeab32cc9361acf8e5dce8944 Mon Sep 17 00:00:00 2001 From: Qball Cow Date: Mon, 20 Aug 2007 14:02:35 +0000 Subject: Add 'lsplaylists' command git-svn-id: https://svn.musicpd.org/mpd/branches/q-mpd@6768 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/command.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/command.c b/src/command.c index 85f2616af..15eb9e0e8 100644 --- a/src/command.c +++ b/src/command.c @@ -92,6 +92,8 @@ #define COMMAND_DEVICES "outputs" #define COMMAND_COMMANDS "commands" #define COMMAND_NOTCOMMANDS "notcommands" + +#define COMMAND_LS_PLAYLISTS "lsplaylists" #define COMMAND_PLAYLISTCLEAR "playlistclear" #define COMMAND_PLAYLISTADD "playlistadd" #define COMMAND_PLAYLISTFIND "playlistfind" @@ -419,13 +421,18 @@ static int handleLsInfo(int fd, int *permission, int argc, char *argv[]) if (printDirectoryInfo(fd, path) < 0) return -1; - +/* Disable listing of playlists if (isRootDirectory(path)) return lsPlaylists(fd, path); - +*/ return 0; } +static int handleLsPlaylists(int fd, int *permission, int argc, char *argv[]) +{ + return lsPlaylists(fd, "/"); +} + static int handleRm(int fd, int *permission, int argc, char *argv[]) { return deletePlaylist(fd, argv[1]); @@ -1132,6 +1139,7 @@ void initCommands(void) addCommand(COMMAND_LISTPLAYLIST, PERMISSION_READ, 1, 1, handleListPlaylist, NULL); addCommand(COMMAND_LISTPLAYLISTINFO, PERMISSION_READ, 1, 1, handleListPlaylistInfo, NULL); addCommand(COMMAND_LSINFO, PERMISSION_READ, 0, 1, handleLsInfo, NULL); + addCommand(COMMAND_LS_PLAYLISTS, PERMISSION_READ, 0, 0, handleLsPlaylists, NULL); addCommand(COMMAND_RM, PERMISSION_CONTROL, 1, 1, handleRm, NULL); addCommand(COMMAND_PLAYLISTINFO, PERMISSION_READ, 0, 1, handlePlaylistInfo, NULL); addCommand(COMMAND_FIND, PERMISSION_READ, 2, -1, handleFind, NULL); -- cgit v1.2.3