Modal blur bg; Editing/creating playlists with descriptions and collab
This commit is contained in:
@ -1072,10 +1072,17 @@ export function toggleAlbumInLibrary( uri, method ){
|
||||
* ======================================================================================
|
||||
**/
|
||||
|
||||
export function createPlaylist( name, is_public ){
|
||||
export function createPlaylist( name, description, is_public, is_collaborative ){
|
||||
return (dispatch, getState) => {
|
||||
|
||||
sendRequest( dispatch, getState, 'users/'+ getState().spotify.me.id +'/playlists/', 'POST', { name: name, public: is_public } )
|
||||
var data = {
|
||||
name: name,
|
||||
description: description,
|
||||
public: is_public,
|
||||
collaborative: is_collaborative
|
||||
}
|
||||
|
||||
sendRequest(dispatch, getState, 'users/'+ getState().spotify.me.id +'/playlists/', 'POST', data)
|
||||
.then( response => {
|
||||
|
||||
dispatch({
|
||||
@ -1102,13 +1109,14 @@ export function createPlaylist( name, is_public ){
|
||||
}
|
||||
}
|
||||
|
||||
export function savePlaylist(uri, name, is_public, description){
|
||||
export function savePlaylist(uri, name, description, is_public, is_collaborative){
|
||||
return (dispatch, getState) => {
|
||||
|
||||
var data = {
|
||||
name: name,
|
||||
name: name,
|
||||
description: description,
|
||||
public: is_public,
|
||||
description: description
|
||||
collaborative: is_collaborative
|
||||
}
|
||||
|
||||
sendRequest( dispatch, getState, 'users/'+ getState().spotify.me.id +'/playlists/'+ helpers.getFromUri('playlistid',uri), 'PUT', data)
|
||||
@ -1119,6 +1127,7 @@ export function savePlaylist(uri, name, is_public, description){
|
||||
playlist: {
|
||||
name: name,
|
||||
public: is_public,
|
||||
collaborative: is_collaborative,
|
||||
description: description
|
||||
}
|
||||
})
|
||||
|
||||
@ -23,7 +23,7 @@ const SpotifyMiddleware = (function(){
|
||||
store.dispatch( uiActions.createNotification( "Must be logged in to Spotify to do that", 'bad' ) )
|
||||
return
|
||||
}
|
||||
store.dispatch( spotifyActions.createPlaylist( action.name, action.is_private ))
|
||||
store.dispatch( spotifyActions.createPlaylist( action.name, action.description, action.is_private, action.is_collaborative ))
|
||||
break
|
||||
|
||||
case 'SPOTIFY_REMOVE_PLAYLIST_TRACKS':
|
||||
@ -72,7 +72,7 @@ const SpotifyMiddleware = (function(){
|
||||
store.dispatch( uiActions.createNotification( "Must be logged in to Spotify to do that", 'bad' ) )
|
||||
return
|
||||
}
|
||||
store.dispatch( spotifyActions.savePlaylist( action.key, action.name, action.is_public, action.description ))
|
||||
store.dispatch( spotifyActions.savePlaylist( action.key, action.name, action.description, action.is_public, action.is_collaborative ))
|
||||
break
|
||||
|
||||
// when radio returns
|
||||
|
||||
@ -130,7 +130,7 @@ export function reorderPlaylistTracks( uri, indexes, insert_before, snapshot_id
|
||||
}
|
||||
}
|
||||
|
||||
export function savePlaylist(uri, name, is_public = false, description = ''){
|
||||
export function savePlaylist(uri, name, description = '', is_public = false, is_collaborative = false){
|
||||
switch( helpers.uriSource( uri ) ){
|
||||
|
||||
case 'spotify':
|
||||
@ -138,8 +138,9 @@ export function savePlaylist(uri, name, is_public = false, description = ''){
|
||||
type: 'SPOTIFY_SAVE_PLAYLIST',
|
||||
key: uri,
|
||||
name: name,
|
||||
description: (description == '' ? null : description),
|
||||
is_public: is_public,
|
||||
description: (description == '' ? null : description)
|
||||
is_collaborative: is_collaborative
|
||||
}
|
||||
|
||||
case 'm3u':
|
||||
@ -152,14 +153,16 @@ export function savePlaylist(uri, name, is_public = false, description = ''){
|
||||
return false
|
||||
}
|
||||
|
||||
export function createPlaylist( scheme, name, is_public = false ){
|
||||
export function createPlaylist(scheme, name, description = '', is_public = false, is_collaborative = false){
|
||||
switch( scheme ){
|
||||
|
||||
case 'spotify':
|
||||
return {
|
||||
type: 'SPOTIFY_CREATE_PLAYLIST',
|
||||
name: name,
|
||||
is_public: is_public
|
||||
description: (description == '' ? null : description),
|
||||
is_public: is_public,
|
||||
is_collaborative: is_collaborative
|
||||
}
|
||||
|
||||
case 'm3u':
|
||||
|
||||
Reference in New Issue
Block a user