summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4e3fd05)
raw | patch | inline | side by side (parent: 4e3fd05)
author | Max Kellermann <max@duempel.org> | |
Sat, 17 Oct 2009 23:36:05 +0000 (01:36 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sat, 17 Oct 2009 23:36:05 +0000 (01:36 +0200) |
MPD 0.16 supports "delete" with a range.
src/mpdclient.c | patch | blob | history |
diff --git a/src/mpdclient.c b/src/mpdclient.c
index 554e564af443451e046add42c3801c95cd02cbd9..97cf78b3d19df3b341519cab5a7c9acd217b55f9 100644 (file)
--- a/src/mpdclient.c
+++ b/src/mpdclient.c
mpd_command_list_begin(connection, false);
- while (--length >= 0)
- if (length != current)
- mpd_send_delete(connection, length);
+ if (mpd_connection_cmp_server_version(connection, 0, 16, 0) >= 0) {
+ if (current < length - 1)
+ mpd_send_delete_range(connection, current + 1, length);
+ if (current > 0)
+ mpd_send_delete_range(connection, 0, current);
+ } else
+ while (--length >= 0)
+ if (length != current)
+ mpd_send_delete(connection, length);
mpd_command_list_end(connection);