queue/PlaylistEdit: fix relative destination offset when moving a range
Commit 13208bf5a7
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
This commit is contained in:
parent
0b9435858b
commit
12a86c4975
2
NEWS
2
NEWS
|
@ -1,4 +1,6 @@
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue