On 2009/03/27 03:51, Jeffrey Middleton <jefr...@gmail.com> wrote:
> I thought it was worth clarifying part of the move range command: it moves
> the first song in the given range to the destination position, and the rest
> of the range follows it.  (This much is said in the commit message)

This is not what your code does.  Imagine "move 0:10 1", if you'd move
this one by one, you would interchange swap the first two songs over
and over.

> This can be counterintuitive; for example, to move the range to the
> end of the playlist, the destination is the length of the range
> short of the end of the playlist.  Similar trickiness to move to a
> desired position between two existing songs.  This will mean some
> work on the client side, unfortunately.  However, the alternative -
> having the block move to just after (or before) the song in the
> indicated position - makes things as simple as moving the block down
> one difficult - you have to specify a position one after the end of
> the range, rather simply the position one greater than the starting
> position.  To sum up, I think this is the method that makes the most
> sense, but am quite open to suggestions.

I believe the approach you chose in your code was the best: the
destination position is the new position of the first item in the
range.  Everything else will be more complicated (to understand and to
implement), because of overlapping ranges and possible playlist
corruption if you do it wrong...

Max

------------------------------------------------------------------------------
_______________________________________________
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team

Reply via email to