Playlist and Users data storage overhaul

This commit is contained in:
James Barnsley
2018-08-31 16:04:55 +12:00
parent 02ab0616fa
commit dbb5effbb9
21 changed files with 15035 additions and 11241 deletions

View File

@ -33,15 +33,15 @@ class Artist extends React.Component{
componentDidMount(){
this.setWindowTitle();
this.loadArtist();
this.props.coreActions.loadArtist(this.props.params.uri);
}
componentWillReceiveProps(nextProps){
if (nextProps.params.uri != this.props.params.uri){
this.loadArtist(nextProps);
this.props.coreActions.loadArtist(nextProps.params.uri);
}else if (!this.props.mopidy_connected && nextProps.mopidy_connected){
if (helpers.uriSource(this.props.params.uri ) != 'spotify'){
this.loadArtist(nextProps);
this.props.coreActions.loadArtist(nextProps.params.uri);
}
}
@ -72,30 +72,6 @@ class Artist extends React.Component{
this.props.uiActions.showContextMenu(data);
}
loadArtist(props = this.props){
switch(helpers.uriSource(props.params.uri )){
case 'spotify':
if (props.artist && props.artist.albums_uris && props.artist.related_artists_uris){
console.info('Loading spotify artist from index');
} else {
this.props.spotifyActions.getArtist(props.params.uri, true);
}
this.props.spotifyActions.following(props.params.uri);
break
default:
if (props.mopidy_connected){
if (props.artist && props.artist.images && props.artist.albums_uris){
console.info('Loading local artist from index');
} else {
this.props.mopidyActions.getArtist(props.params.uri);
}
}
break
}
}
loadMore(){
this.props.spotifyActions.getMore(
this.props.artist.albums_more,