2010-05-10, 19:50
I agree that the functionality should be there, just not sure I like the implementation.
I would imagine most usage scenarios is that you want to just move one item to a specific position, as drag and drop in the example, so how about Playlist.Move(playlist-virtual="foo", from=5, to=0)?
I guess it could take 2 arrays aswell if one needs to do alot of altering?
Otherwise a Playlist.Sort(playlist-virtual="foo", order=[5, 0, 1, 2, 3, 4, 6]) could be used but would need some usage cases on that one.
What would happen if order=[4, 4, 1, 2] and what would happen if list is 0->6 and you do order=[6, 1, 3] and so on. If I get a good spec on that I can probably work something out
I would imagine most usage scenarios is that you want to just move one item to a specific position, as drag and drop in the example, so how about Playlist.Move(playlist-virtual="foo", from=5, to=0)?
I guess it could take 2 arrays aswell if one needs to do alot of altering?
Otherwise a Playlist.Sort(playlist-virtual="foo", order=[5, 0, 1, 2, 3, 4, 6]) could be used but would need some usage cases on that one.
What would happen if order=[4, 4, 1, 2] and what would happen if list is 0->6 and you do order=[6, 1, 3] and so on. If I get a good spec on that I can probably work something out