Fully operational mopidy middleware; Spotify middleware next

This commit is contained in:
James Barnsley
2016-10-16 12:37:37 +13:00
parent ec7d6ae895
commit 9fddcc9948
20 changed files with 335 additions and 386 deletions

View File

@ -18,19 +18,21 @@ class Album extends React.Component{
// on render
componentDidMount(){
this.loadAlbum( this.props.params.id );
this.loadAlbum( this.props.params.uri );
}
// when props changed
componentWillReceiveProps( nextProps ){
if( nextProps.params.id != this.props.params.id ){
this.loadAlbum( nextProps.params.id );
if( nextProps.params.uri != this.props.params.uri ){
this.loadAlbum( nextProps.params.uri );
}
}
loadAlbum( id ){
loadAlbum( uri ){
let self = this;
var id = uri.replace('spotify:album:','');
$.ajax({
method: 'GET',
cache: true,