Loving track; Investigating scrobbling

This commit is contained in:
James Barnsley
2017-11-06 16:59:21 +13:00
parent ffba601e4b
commit 2d3d4c351a
5 changed files with 140 additions and 55 deletions

View File

@ -32,6 +32,16 @@ const LastfmMiddleware = (function(){
next(action);
break;
case 'MOPIDY_CURRENTTLTRACK':
if (action.data && action.data.track){
if (state.lastfm.session){
store.dispatch(lastfmActions.scrobble(action.data.track));
}
}
next(action);
break;
// This action is irrelevant to us, pass it on to the next middleware
default:
return next(action);