Loading library albums only on demand

This commit is contained in:
James Barnsley
2017-08-11 21:59:14 +12:00
parent 190a20c882
commit 9bb4b79f1e
12 changed files with 58 additions and 61 deletions

View File

@ -167,6 +167,17 @@ export function addTracksToPlaylist( uri, tracks_uris ){
}
/**
* Asset libraries
**/
export function getLibraryPlaylists(){
return {
type: 'GET_LIBRARY_PLAYLISTS'
}
}
/**
* Assets loaded
**/

View File

@ -254,6 +254,16 @@ const CoreMiddleware = (function(){
next(action)
break
case 'GET_LIBRARY_PLAYLISTS':
if (store.getState().spotify.connected){
store.dispatch(spotifyActions.getLibraryPlaylists())
}
if (store.getState().mopidy.connected){
store.dispatch(mopidyActions.getLibraryPlaylists())
}
next(action)
break
case 'RESTART':
location.reload()
break