Tracklists are sortable with ONLY the first bunch; Playlist and queue sorting

This commit is contained in:
James Barnsley
2016-11-16 16:30:49 +13:00
parent 86b9665ec8
commit 04abfe6f2b
7 changed files with 87 additions and 28 deletions

View File

@ -59,16 +59,17 @@ export function dragEnd(){
return { type: 'DRAG_END' }
}
export function reorderPlaylistTracks( uri, indexes, to_index, snapshot_id = false ){
export function reorderPlaylistTracks( uri, indexes, insert_before, snapshot_id = false ){
var range = helpers.createRange( indexes );
switch( helpers.uriSource( uri ) ){
case 'spotify':
// TODO: handle bunched selected tracks (ie non-continuious indexes)
return {
type: 'SPOTIFY_REORDER_PLAYLIST_TRACKS',
uri: uri,
indexes: indexes,
to_index: to_index,
range_start: range.start,
range_length: range.length,
insert_before: insert_before,
snapshot_id: snapshot_id
}
@ -76,8 +77,9 @@ export function reorderPlaylistTracks( uri, indexes, to_index, snapshot_id = fal
return {
type: 'MOPIDY_REORDER_PLAYLIST_TRACKS',
uri: uri,
indexes: indexes,
to_index: to_index
range_start: range.start,
range_length: range.length,
insert_before: insert_before
}
}
}