command: restore the "playlistinfo -1" behavior
If a range is "-1", display the whole list. This behavior is undocumented, but some clients rely on it.
This commit is contained in:
parent
e33cd80f25
commit
983822ea52
@ -177,6 +177,14 @@ check_range(struct client *client, unsigned *value_r1, unsigned *value_r2,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (value == -1 && *test == 0) {
|
||||||
|
/* compatibility with older MPD versions: specifying
|
||||||
|
"-1" makes MPD display the whole list */
|
||||||
|
*value_r1 = 0;
|
||||||
|
*value_r2 = UINT_MAX;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (value < 0) {
|
if (value < 0) {
|
||||||
command_error(client, ACK_ERROR_ARG,
|
command_error(client, ACK_ERROR_ARG,
|
||||||
"Number is negative: %s", s);
|
"Number is negative: %s", s);
|
||||||
|
Loading…
Reference in New Issue
Block a user