Commit 12a86c49 authored by Max Kellermann's avatar Max Kellermann

queue/PlaylistEdit: fix relative destination offset when moving a range

Commit 13208bf5 added range support to the `move` command, but applied the wrong offset to the `to` variable. When the source range is before the current song, and the song thus gets decremented by the range size, then the final destination offset must also be decremented by the range size. Closes https://github.com/MusicPlayerDaemon/MPD/issues/663
parent 0b943585
ver 0.21.16 (not yet released)
* queue
- fix relative destination offset when moving a range
* storage
- curl: request the "resourcetype" property to fix database update
- curl: URL-encode more paths
......
......@@ -353,7 +353,7 @@ playlist::MoveRange(PlayerControl &pc, unsigned start, unsigned end, int to)
return;
to = (currentSong + abs(to)) % GetLength();
if (start < (unsigned)to)
to--;
to -= end - start;
}
queue.MoveRange(start, end, to);
......
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