Trying to play once added

This commit is contained in:
James Barnsley
2016-10-19 14:09:34 +13:00
parent 51bf248ac9
commit 9e2b5aac3a
11 changed files with 120 additions and 32 deletions

View File

@ -33,12 +33,29 @@ class Queue extends React.Component{
renderTrackList(){
if( this.props.mopidy && this.props.mopidy.tracks ){
return (
<TrackList tracks={this.props.mopidy.tracks} />
<TrackList
tracks={this.props.mopidy.tracks}
removeTracks={ tracks => this.removeTracks( tracks ) }
playTracks={ null }
playTrack={ track => this.playTrack( track ) }
/>
);
}
return null;
}
removeTracks( tracks ){
var tlids = [];
for( var i = 0; i < tracks.length; i++ ){
tlids.push( tracks[i].tlid )
}
this.props.actions.removeTracks( tlids )
}
playTrack( track ){
this.props.actions.changeTrack( track.tlid )
}
render(){
return (
<div>