Categories in full index
This commit is contained in:
@ -870,7 +870,25 @@ export function createPlaylist( name, is_public ){
|
||||
|
||||
sendRequest( dispatch, getState, 'users/'+ getState().spotify.me.id +'/playlists/', 'POST', { name: name, public: is_public } )
|
||||
.then( response => {
|
||||
dispatch( getAllLibraryPlaylists() );
|
||||
|
||||
dispatch({
|
||||
type: 'PLAYLIST_LOADED',
|
||||
key: response.uri,
|
||||
playlist: Object.assign(
|
||||
{},
|
||||
response,
|
||||
{
|
||||
can_edit: true,
|
||||
tracks: [],
|
||||
tracks_more: null,
|
||||
tracks_total: 0
|
||||
})
|
||||
});
|
||||
|
||||
dispatch({
|
||||
type: 'LIBRARY_PLAYLISTS_LOADED',
|
||||
uris: [response.uri]
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -950,9 +968,9 @@ export function toggleFollowingPlaylist( uri, method ){
|
||||
sendRequest( dispatch, getState, 'users/'+ helpers.getFromUri('userid',uri) + '/playlists/'+ helpers.getFromUri('playlistid',uri) + '/followers', method )
|
||||
.then( response => {
|
||||
dispatch({
|
||||
type: 'SPOTIFY_PLAYLIST_FOLLOWING',
|
||||
type: 'SPOTIFY_PLAYLIST_FOLLOWING_LOADED',
|
||||
key: uri,
|
||||
data: new_state
|
||||
is_following: new_state
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ const SpotifyMiddleware = (function(){
|
||||
break
|
||||
|
||||
case 'SPOTIFY_REMOVE_PLAYLIST_TRACKS':
|
||||
var playlist = state.ui.playlists[action.uri]
|
||||
var playlist = state.ui.playlists[action.key]
|
||||
|
||||
if( !store.getState().spotify.authorized ){
|
||||
store.dispatch( uiActions.createNotification( "Must be logged in to Spotify to do that", 'bad' ) )
|
||||
@ -46,7 +46,7 @@ const SpotifyMiddleware = (function(){
|
||||
store.dispatch( uiActions.createNotification( "Must be logged in to Spotify to do that", 'bad' ) )
|
||||
return
|
||||
}
|
||||
store.dispatch( spotifyActions.addTracksToPlaylist( action.uri, action.tracks_uris ))
|
||||
store.dispatch( spotifyActions.addTracksToPlaylist( action.key, action.tracks_uris ))
|
||||
break
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ const SpotifyMiddleware = (function(){
|
||||
store.dispatch( uiActions.createNotification( "Must be logged in to Spotify to do that", 'bad' ) )
|
||||
return
|
||||
}
|
||||
store.dispatch( spotifyActions.reorderPlaylistTracks( action.uri, action.range_start, action.range_length, action.insert_before, action.snapshot_id ))
|
||||
store.dispatch( spotifyActions.reorderPlaylistTracks( action.key, action.range_start, action.range_length, action.insert_before, action.snapshot_id ))
|
||||
break
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ const SpotifyMiddleware = (function(){
|
||||
store.dispatch( uiActions.createNotification( "Must be logged in to Spotify to do that", 'bad' ) )
|
||||
return
|
||||
}
|
||||
store.dispatch( spotifyActions.savePlaylist( action.uri, action.name, action.is_public ))
|
||||
store.dispatch( spotifyActions.savePlaylist( action.key, action.name, action.is_public ))
|
||||
break
|
||||
|
||||
// when our mopidy server current track changes
|
||||
|
||||
Reference in New Issue
Block a user