Albums and playlists now loading using processes

This commit is contained in:
James Barnsley
2017-08-12 00:02:41 +12:00
parent 6d2bf7ff87
commit 884d3fdd49
11 changed files with 183 additions and 105 deletions

View File

@ -177,6 +177,18 @@ export function getLibraryPlaylists(){
}
}
export function getLibraryAlbums(){
return {
type: 'GET_LIBRARY_ALBUMS'
}
}
export function getLibraryArtists(){
return {
type: 'GET_LIBRARY_ARTISTS'
}
}
/**
* Assets loaded

View File

@ -264,6 +264,26 @@ const CoreMiddleware = (function(){
next(action)
break
case 'GET_LIBRARY_ALBUMS':
if (store.getState().spotify.connected){
store.dispatch(spotifyActions.getLibraryAlbums())
}
if (store.getState().mopidy.connected){
store.dispatch(mopidyActions.getLibraryAlbums())
}
next(action)
break
case 'GET_LIBRARY_ARTISTS':
if (store.getState().spotify.connected){
store.dispatch(spotifyActions.getLibraryArtists())
}
if (store.getState().mopidy.connected){
store.dispatch(mopidyActions.getLibraryArtists())
}
next(action)
break
case 'RESTART':
location.reload()
break