Dater; Basic grid responsive; Local formatting

This commit is contained in:
James Barnsley
2016-11-02 16:51:00 +13:00
parent 4fdbef2b4e
commit 1920e69e60
133 changed files with 18350 additions and 5599 deletions

View File

@ -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'
}
}

View File

@ -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;

View File

@ -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
}