Track template with extra info; Context menu to get to tracks
This commit is contained in:
@ -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'
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user