Code

mpdclient: fall back to simple "deleteid" if range is 1
authorMax Kellermann <max@duempel.org>
Sat, 10 Oct 2009 17:09:26 +0000 (19:09 +0200)
committerMax Kellermann <max@duempel.org>
Sat, 10 Oct 2009 17:09:26 +0000 (19:09 +0200)
src/mpdclient.c

index 30e0fe68fe9a9d5ce0a33e198223d6b9de33b9ff..e380ac0dc8cae56102e4e5fb1fe680a7bcf97ef8 100644 (file)
@@ -544,6 +544,11 @@ mpdclient_cmd_delete_range(struct mpdclient *c, unsigned start, unsigned end)
        struct mpd_connection *connection;
        struct mpd_status *status;
 
+       if (end == start + 1)
+               /* if that's not really a range, we choose to use the
+                  safer "deleteid" version */
+               return mpdclient_cmd_delete(c, start);
+
        connection = mpdclient_get_connection(c);
        if (connection == NULL)
                return false;