Preventing shuffling of playlists you don't own

This commit is contained in:
James Barnsley
2017-01-27 12:13:18 +13:00
parent 60f49d4611
commit c22c93428d
2 changed files with 6 additions and 0 deletions

View File

@ -56,6 +56,11 @@ const SpotifyMiddleware = (function(){
store.dispatch( uiActions.createNotification( "Must be logged in to Spotify to do that", 'bad' ) )
return
}
if( !store.getState().spotify.me || store.getState().spotify.me.id != helpers.getFromUri('artistid',action.key) ){
store.dispatch( uiActions.createNotification( "You can't edit a playlist you don't own", 'bad' ) )
return
}
store.dispatch( spotifyActions.reorderPlaylistTracks( action.key, action.range_start, action.range_length, action.insert_before, action.snapshot_id ))
break