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

@ -6635,6 +6635,10 @@ main .track-view {
.discover-view section .grid { .discover-view section .grid {
padding-bottom: 20px; } padding-bottom: 20px; }
.discover-view section.tracks .pull-right .button,
.discover-view section.tracks .pull-right button {
margin-right: 0; }
@media (max-width: 800px) { @media (max-width: 800px) {
.discover-view .intro { .discover-view .intro {
padding: 40px 20px; } padding: 40px 20px; }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6635,6 +6635,10 @@ main .track-view {
.discover-view section .grid { .discover-view section .grid {
padding-bottom: 20px; } padding-bottom: 20px; }
.discover-view section.tracks .pull-right .button,
.discover-view section.tracks .pull-right button {
margin-right: 0; }
@media (max-width: 800px) { @media (max-width: 800px) {
.discover-view .intro { .discover-view .intro {
padding: 40px 20px; } padding: 40px 20px; }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -98,7 +98,7 @@
// Release details // Release details
// These are automatically injected to built HTML // These are automatically injected to built HTML
var build = "1536884089"; var build = "1536969338";
var version = "3.25.1"; var version = "3.25.1";
// Construct the script tag // Construct the script tag

View File

@ -41,6 +41,7 @@ export default class LazyLoadListener extends React.Component{
this.setState( this.setState(
{listening: false}, {listening: false},
() => { () => {
console.info('Loading more: '+this.props.loadKey);
this.props.loadMore(); this.props.loadMore();
} }
); );

View File

@ -589,8 +589,15 @@ const CoreMiddleware = (function(){
}*/ }*/
if (raw_album.tracks){ if (raw_album.tracks){
album.tracks_uris = helpers.arrayOf('uri', raw_album.tracks); album.tracks_uris = [];
tracks_loaded = [...tracks_loaded, ...raw_album.tracks];
for (var track of raw_album.tracks){
if (!track.album){
track.album = helpers.formatSimpleObject(album);
}
album.tracks_uris.push(track.uri);
tracks_loaded.push(track);
}
} }
if (raw_album.artists){ if (raw_album.artists){

View File

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

View File

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

View File

@ -193,6 +193,15 @@
.grid { .grid {
padding-bottom: 20px; padding-bottom: 20px;
} }
&.tracks {
.pull-right {
.button,
button {
margin-right: 0;
}
}
}
} }
@include responsive($bp_medium){ @include responsive($bp_medium){