Multiple playlists; Removing debug code
This commit is contained in:
@ -199,7 +199,7 @@ const UIMiddleware = (function(){
|
||||
break
|
||||
|
||||
case 'PLAYLIST_LOADED':
|
||||
var playlist = action.playlist
|
||||
var playlist = Object.assign({}, action.playlist)
|
||||
|
||||
switch (helpers.uriSource(playlist.uri)){
|
||||
|
||||
@ -210,8 +210,6 @@ const UIMiddleware = (function(){
|
||||
case 'spotify':
|
||||
if (store.getState().spotify.authorized && store.getState().spotify.me){
|
||||
playlist.can_edit = (helpers.getFromUri('playlistowner',playlist.uri) == store.getState().spotify.me.id)
|
||||
} else {
|
||||
console.log('nah')
|
||||
}
|
||||
}
|
||||
|
||||
@ -220,6 +218,32 @@ const UIMiddleware = (function(){
|
||||
next(action)
|
||||
break
|
||||
|
||||
case 'PLAYLISTS_LOADED':
|
||||
var playlists = []
|
||||
|
||||
for (var i = 0; i < action.playlists.length; i++){
|
||||
var playlist = Object.assign({}, action.playlists[i])
|
||||
|
||||
switch (helpers.uriSource(playlist.uri)){
|
||||
|
||||
case 'm3u':
|
||||
playlist.can_edit = true
|
||||
break
|
||||
|
||||
case 'spotify':
|
||||
if (store.getState().spotify.authorized && store.getState().spotify.me){
|
||||
playlist.can_edit = (helpers.getFromUri('playlistowner',playlist.uri) == store.getState().spotify.me.id)
|
||||
}
|
||||
}
|
||||
|
||||
playlists.push(playlist)
|
||||
}
|
||||
|
||||
// proceed as usual
|
||||
action.playlists = playlists
|
||||
next(action)
|
||||
break
|
||||
|
||||
|
||||
case 'MOPIDY_STATE':
|
||||
helpers.setWindowTitle(store.getState().ui.current_track, action.data)
|
||||
|
||||
Reference in New Issue
Block a user