Track template with extra info; Context menu to get to tracks

This commit is contained in:
James Barnsley
2017-10-10 11:50:29 +13:00
parent a793830d8d
commit 0ca37b0f62
9 changed files with 187 additions and 13 deletions

View File

@ -201,6 +201,13 @@ export function getDirectory( uri ){
}
}
export function getTrack( uri ){
return {
type: 'MOPIDY_GET_TRACK',
data: { uri: uri }
}
}
export function getLibraryArtists(){
return {
type: 'MOPIDY_GET_LIBRARY_ARTISTS'

View File

@ -1703,6 +1703,27 @@ const MopidyMiddleware = (function(){
next(action)
break
case 'MOPIDY_GET_TRACK':
instruct( socket, store, 'library.lookup', action.data )
.then(
response => {
if (response.length > 0){
store.dispatch({
type: 'TRACK_LOADED',
key: action.data.uri,
track: response[0]
});
}
},
error => {
store.dispatch(coreActions.handleException(
"Mopidy: "+(error.message ? error.message : "Could not get track"),
error
));
}
)
break
/**