Tracks library, all part of fixing #324

This commit is contained in:
James Barnsley
2018-09-15 11:58:26 +12:00
parent f66b33c3e4
commit cbdd2c4ad3
12 changed files with 10647 additions and 13866 deletions

View File

@ -449,8 +449,10 @@ class Discover extends React.Component{
<section className="col w70 tracks">
<h4>
Tracks
<ContextMenuTrigger onTrigger={e => this.handleContextMenu(e)} />
<button className="primary pull-right" onClick={e => this.playTracks(e)}>Play all</button>
<div className="pull-right">
<ContextMenuTrigger onTrigger={e => this.handleContextMenu(e)} />
<button className="primary" onClick={e => this.playTracks(e)}>Play all</button>
</div>
</h4>
<TrackList className="discover-track-list" uri={uri} tracks={tracks} />
</section>

View File

@ -24,11 +24,9 @@ class LibraryTracks extends React.Component{
componentDidMount(){
this.props.uiActions.setWindowTitle("Tracks");
if (!this.props.spotify_enabled){
if (!this.props.spotify_me){
this.props.uiActions.createNotification({type: 'warning', content: 'Enable Spotify to browse tracks'});
}
if (this.props.spotify_enabled && this.props.library_tracks === undefined){
} else if (this.props.library_tracks === undefined){
this.props.spotifyActions.getLibraryTracks();
}
}
@ -107,7 +105,7 @@ const mapStateToProps = (state, ownProps) => {
return {
load_queue: state.ui.load_queue,
tracks: state.core.tracks,
spotify_enabled: (state.mopidy.uri_schemes && state.mopidy.uri_schemes.includes('spotify:')),
spotify_me: state.spotify.me,
library_tracks: state.spotify.library_tracks,
library_tracks_more: state.spotify.library_tracks_more
}