aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
authorJeffrey Middleton <jeffrey.r.middleton@nasa.gov>2009-03-26 22:02:56 +0100
committerMax Kellermann <max@duempel.org>2009-03-26 22:02:56 +0100
commit13208bf5a7c91a6406195139f1068f173ccdac94 (patch)
tree9e4d346b9ec78eb84be3f7cb079206eb86977fe4 /src/command.c
parent7684c446c6f9b699ae4ea30b59cde81ec31efa53 (diff)
downloadmpd-13208bf5a7c91a6406195139f1068f173ccdac94.tar.gz
mpd-13208bf5a7c91a6406195139f1068f173ccdac94.tar.xz
mpd-13208bf5a7c91a6406195139f1068f173ccdac94.zip
queue/playlist/command: move range
The move command now accepts a range for the first argument, in the same form as other range commands, e.g. move 15:17 3. The first song in the range is placed at the destination position. Note that as with other range commands, the range is inclusive on the left only; this example would move only songs 15 and 16, not 17. [mk: fixed signed/unsigned warnings; use G_MAXUINT instead of UINT_MAX]
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/command.c b/src/command.c
index 7603f669c..1b8c45f26 100644
--- a/src/command.c
+++ b/src/command.c
@@ -1181,14 +1181,16 @@ handle_list(struct client *client, int argc, char *argv[])
static enum command_return
handle_move(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
{
- int from, to;
+ unsigned start, end;
+ int to;
enum playlist_result result;
- if (!check_int(client, &from, argv[1], check_integer, argv[1]))
+ if (!check_range(client, &start, &end,
+ argv[1], need_range))
return COMMAND_RETURN_ERROR;
if (!check_int(client, &to, argv[2], check_integer, argv[2]))
return COMMAND_RETURN_ERROR;
- result = moveSongInPlaylist(&g_playlist, from, to);
+ result = moveSongRangeInPlaylist(&g_playlist, start, end, to);
return print_playlist_result(client, result);
}