diff options
author | Max Kellermann <max@musicpd.org> | 2019-10-15 17:00:16 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-10-15 17:00:16 +0200 |
commit | 12a86c49759f36c20dbd61317fd4bc2508eb30eb (patch) | |
tree | e0b755f961d8716b4c9591cc2b429ab3934ce8c3 | |
parent | 0b9435858b7bfc68b9a73d6b26eb6c8c5c0d7f13 (diff) |
queue/PlaylistEdit: fix relative destination offset when moving a range
Commit 13208bf5a7c91a6406195139f1068f173ccdac94 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
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | src/queue/PlaylistEdit.cxx | 2 |
2 files changed, 3 insertions, 1 deletions
@@ -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 diff --git a/src/queue/PlaylistEdit.cxx b/src/queue/PlaylistEdit.cxx index a0e504f44..9a2b37eed 100644 --- a/src/queue/PlaylistEdit.cxx +++ b/src/queue/PlaylistEdit.cxx @@ -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); |