Commit 78e49928 authored by Max Kellermann's avatar Max Kellermann

command/QueueCommands: disallow moving the current song relative to itself

This was a no-op previously, but this operation makes no sense.
parent c0bcfe24
...@@ -378,8 +378,7 @@ ParseMoveDestination(const char *s, const RangeArg range, ...@@ -378,8 +378,7 @@ ParseMoveDestination(const char *s, const RangeArg range,
unsigned current = RequireCurrentPosition(p); unsigned current = RequireCurrentPosition(p);
assert(current < queue_length); assert(current < queue_length);
if (range.Contains(current)) if (range.Contains(current))
/* no-op */ throw ProtocolError(ACK_ERROR_ARG, "Cannot move current song relative to itself");
return range.start;
if (current >= range.end) if (current >= range.end)
current -= range.Count(); current -= range.Count();
...@@ -393,8 +392,7 @@ ParseMoveDestination(const char *s, const RangeArg range, ...@@ -393,8 +392,7 @@ ParseMoveDestination(const char *s, const RangeArg range,
unsigned current = RequireCurrentPosition(p); unsigned current = RequireCurrentPosition(p);
assert(current < queue_length); assert(current < queue_length);
if (range.Contains(current)) if (range.Contains(current))
/* no-op */ throw ProtocolError(ACK_ERROR_ARG, "Cannot move current song relative to itself");
return range.start;
if (current >= range.end) if (current >= range.end)
current -= range.Count(); current -= range.Count();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment