Current track now using full track index

This commit is contained in:
James Barnsley
2017-06-07 09:05:56 +12:00
parent 065d4e0a63
commit d2261878c7
7 changed files with 64 additions and 54 deletions

View File

@ -995,6 +995,29 @@ const MopidyMiddleware = (function(){
break;
/**
* =============================================================== TRACKS ================
* ======================================================================================
**/
case 'MOPIDY_CURRENTTLTRACK':
if (!action.data || !action.data.track){
return mopidy
}
// Fire off our universal track index loader
store.dispatch({ type: 'TRACK_LOADED', key: action.data.track.uri, track: action.data.track })
// When current track is Spotify track, go get the full object
// This is because Mopidy doesn't give us full artist/album objects, without artwork
if (action.data.track.uri.substring(0,14) == 'spotify:track:'){
store.dispatch( spotifyActions.getTrack( action.data.track.uri ) )
}
next(action)
break
/**
* =============================================================== LOCAL ================
* ======================================================================================