Playlist editability with new playlist format

This commit is contained in:
James Barnsley
2018-09-14 16:11:55 +12:00
parent d733f5554c
commit f66b33c3e4
10 changed files with 30 additions and 28 deletions

View File

@ -673,7 +673,7 @@ const CoreMiddleware = (function(){
case 'spotify':
if (store.getState().spotify.authorization && store.getState().spotify.me){
playlist.can_edit = (helpers.getFromUri('playlistowner',playlist.uri) == store.getState().spotify.me.id)
playlist.can_edit = (playlist.owner.id == store.getState().spotify.me.id)
}
}

View File

@ -112,7 +112,7 @@ const localstorageMiddleware = (function(){
helpers.setStorage(
'spotify',
{
me: action.data
me: action.me
}
);
break;

View File

@ -1730,7 +1730,6 @@ const MopidyMiddleware = (function(){
var uris_to_load = uris.splice(0,50);
if (uris_to_load.length > 0){
console.log(uris.length);
store.dispatch(uiActions.updateProcess(
'MOPIDY_LIBRARY_ALBUMS_PROCESSOR',
'Loading '+uris.length+' local albums',

View File

@ -1491,7 +1491,6 @@ export function getPlaylist(uri){
helpers.formatPlaylist(response),
{
is_completely_loaded: true,
can_edit: (getState().spotify.me && response.owner.id == getState().spotify.me.id),
user_uri: response.owner.uri,
tracks_uris: helpers.arrayOf('uri', tracks),
tracks_more: response.tracks.next,
@ -1500,7 +1499,7 @@ export function getPlaylist(uri){
}
)
//dispatch(coreActions.userLoaded(helpers.formatUser(response.owner)));
dispatch(coreActions.userLoaded(helpers.formatUser(response.owner)));
dispatch(coreActions.tracksLoaded(tracks));
dispatch(coreActions.playlistLoaded(playlist));
},