aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/command.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/command.c b/src/command.c
index c8f39472d..84a30db2b 100644
--- a/src/command.c
+++ b/src/command.c
@@ -100,6 +100,7 @@
#define COMMAND_PLAYLISTDELETE "playlistdelete"
#define COMMAND_TAGTYPES "tagtypes"
#define COMMAND_COUNT "count"
+#define COMMAND_RENAME "rename"
#define COMMAND_STATUS_VOLUME "volume"
#define COMMAND_STATUS_STATE "state"
@@ -421,6 +422,11 @@ static int handleRm(int fd, int *permission, int argc, char *argv[])
return deletePlaylist(fd, argv[1]);
}
+static int handleRename(int fd, int *permission, int argc, char *argv[])
+{
+ return renameStoredPlaylist(fd, argv[1], argv[2]);
+}
+
static int handlePlaylistChanges(int fd, int *permission,
int argc, char *argv[])
{
@@ -1117,6 +1123,7 @@ void initCommands(void)
addCommand(COMMAND_PLAYLISTDELETE, PERMISSION_CONTROL, 2, 2, handlePlaylistDelete, NULL);
addCommand(COMMAND_TAGTYPES, PERMISSION_READ, 0, 0, handleTagTypes, NULL);
addCommand(COMMAND_COUNT, PERMISSION_READ, 2, -1, handleCount, NULL);
+ addCommand(COMMAND_RENAME, PERMISSION_CONTROL, 2, 2, handleRename, NULL);
sortList(commandList);
}