diff options
author | Qball Cow <qball@qballcow.nl> | 2007-08-20 14:02:35 +0000 |
---|---|---|
committer | Qball Cow <qball@qballcow.nl> | 2007-08-20 14:02:35 +0000 |
commit | 73e98c387134d44aeab32cc9361acf8e5dce8944 (patch) | |
tree | f4b850c317747c23e601089029d2948f3ae4c0c3 /src/command.c | |
parent | f378b5509ed7faa5382286683b7c8ea96bc6c024 (diff) | |
download | mpd-73e98c387134d44aeab32cc9361acf8e5dce8944.tar.gz mpd-73e98c387134d44aeab32cc9361acf8e5dce8944.tar.xz mpd-73e98c387134d44aeab32cc9361acf8e5dce8944.zip |
Add 'lsplaylists' command
git-svn-id: https://svn.musicpd.org/mpd/branches/q-mpd@6768 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/command.c')
-rw-r--r-- | src/command.c | 12 |
1 files 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); |