Fixing mibd from url for lastfm artwork

This commit is contained in:
James Barnsley
2016-11-25 09:12:56 +13:00
parent 33f27b1767
commit 1489daaad1
4 changed files with 25 additions and 4 deletions

View File

@ -44,6 +44,14 @@ class Artist extends React.Component{
}
}
componentWillUpdate( nextProps, nextState ){
if( nextState.sub_view != this.state.sub_view && nextState.sub_view == 'biography' ){
if( this.props.artist && !this.props.artist.bio ){
this.props.lastfmActions.getArtist( this.props.artist.name.replace('&','and') )
}
}
}
loadArtist( props = this.props ){
var source = helpers.uriSource( props.params.uri );
if( source == 'spotify' ){
@ -94,7 +102,9 @@ class Artist extends React.Component{
<div className="body biography">
<h4 className="left-padding">Biography</h4>
<section className="text-wrapper no-top-padding">
<p>Biography here</p>
{ this.props.artist.bio ? <div><p>{this.props.artist.bio.content}</p><br />
<div className="grey-text">Published: { this.props.artist.bio.published }</div>
<div className="grey-text">Origin: <a href={ this.props.artist.bio.links.link.href } target="_blank">{ this.props.artist.bio.links.link.href }</a></div></div> : null }
</section>
</div>
)