Dater; Basic grid responsive; Local formatting
This commit is contained in:
@ -95,14 +95,6 @@ export function getPlaylists(){
|
||||
return { type: 'MOPIDY_PLAYLISTS' }
|
||||
}
|
||||
|
||||
export function getBrowse( uri ){
|
||||
return {
|
||||
type: 'MOPIDY_INSTRUCT',
|
||||
call: 'library.browse',
|
||||
value: { uri: uri }
|
||||
}
|
||||
}
|
||||
|
||||
export function getPlaylist( uri ){
|
||||
return {
|
||||
type: 'MOPIDY_PLAYLIST',
|
||||
@ -110,6 +102,13 @@ export function getPlaylist( uri ){
|
||||
}
|
||||
}
|
||||
|
||||
export function getDirectory( uri ){
|
||||
return {
|
||||
type: 'MOPIDY_DIRECTORY',
|
||||
data: { uri: uri }
|
||||
}
|
||||
}
|
||||
|
||||
export function getAlbum( uri ){
|
||||
return {
|
||||
type: 'MOPIDY_ALBUM',
|
||||
@ -130,3 +129,9 @@ export function getArtists(){
|
||||
}
|
||||
}
|
||||
|
||||
export function getAlbums(){
|
||||
return {
|
||||
type: 'MOPIDY_ALBUMS'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -264,13 +264,27 @@ const MopidyMiddleware = (function(){
|
||||
})
|
||||
break;
|
||||
|
||||
case 'MOPIDY_DIRECTORY':
|
||||
store.dispatch({ type: 'MOPIDY_DIRECTORY_LOADED', data: false });
|
||||
instruct( socket, store, 'library.browse', action.data )
|
||||
.then( response => {
|
||||
store.dispatch({ type: 'MOPIDY_DIRECTORY_LOADED', data: response });
|
||||
})
|
||||
break;
|
||||
|
||||
case 'MOPIDY_ARTISTS':
|
||||
store.dispatch({ type: 'MOPIDY_ARTISTS_LOADED', data: false });
|
||||
instruct( socket, store, 'library.browse', { uri: 'local:directory?type=artist' } )
|
||||
.then( response => {
|
||||
var artists = response;
|
||||
|
||||
store.dispatch({ type: 'MOPIDY_ARTISTS_LOADED', data: artists });
|
||||
.then( response => {
|
||||
store.dispatch({ type: 'MOPIDY_ARTISTS_LOADED', data: response });
|
||||
})
|
||||
break;
|
||||
|
||||
case 'MOPIDY_ALBUMS':
|
||||
store.dispatch({ type: 'MOPIDY_ALBUMS_LOADED', data: false });
|
||||
instruct( socket, store, 'library.browse', { uri: 'local:directory?type=album' } )
|
||||
.then( response => {
|
||||
store.dispatch({ type: 'MOPIDY_ALBUMS_LOADED', data: response });
|
||||
})
|
||||
break;
|
||||
|
||||
|
||||
@ -72,9 +72,9 @@ export default function reducer(mopidy = {}, action){
|
||||
volume: action.data
|
||||
});
|
||||
|
||||
case 'MOPIDY_BROWSE':
|
||||
case 'MOPIDY_DIRECTORY_LOADED':
|
||||
return Object.assign({}, mopidy, {
|
||||
browse: action.data
|
||||
directory: action.data
|
||||
});
|
||||
|
||||
case 'MOPIDY_PLAYLIST_LOADED':
|
||||
@ -97,6 +97,11 @@ export default function reducer(mopidy = {}, action){
|
||||
artists: action.data
|
||||
});
|
||||
|
||||
case 'MOPIDY_ALBUMS_LOADED':
|
||||
return Object.assign({}, mopidy, {
|
||||
albums: action.data
|
||||
});
|
||||
|
||||
default:
|
||||
return mopidy
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user