+
+ {helpers.uriSource( this.props.params.uri )} album
+
-
-
-
{helpers.uriSource( this.props.params.uri )} album
+
{ this.props.album.name }
+
+
+ { artists.length > 0 ? : null }
+ { this.props.album.release_date ? : null }
+ -
+ { this.props.album.tracks_total ? this.props.album.tracks_total : '0' } tracks,
+ { this.props.album.tracks ? : '0 mins' }
+
+
-
{ this.props.album.name }
+
+
+ { helpers.uriSource(this.props.params.uri) == 'spotify' ? : null }
+
+
+
+ { this.props.album.tracks ? : null }
+ this.loadMore() }/>
+
-
- { artists.length > 0 ? : null }
- { this.props.album.release_date ? : null }
- -
- { this.props.album.tracks_total ? this.props.album.tracks_total : '0' } tracks,
- { this.props.album.tracks ? : '0 mins' }
-
-
+ );
-
-
- { helpers.uriSource(this.props.params.uri) == 'spotify' ?
: null }
+ } else {
+ return (
+
+
+
+
+
+ {helpers.uriSource( this.props.params.uri )} album
+
+
{ this.props.params.uri }
+
+ -
+ 0 tracks,
+ 0 mins
+
+
+
+
+
+
+ );
-
- { this.props.album.tracks ? : null }
- this.loadMore() }/>
-
-
-
- );
+ }
}
}
diff --git a/src/js/views/Artist.js b/src/js/views/Artist.js
index 6b396b86..09628b36 100755
--- a/src/js/views/Artist.js
+++ b/src/js/views/Artist.js
@@ -65,7 +65,7 @@ class Artist extends React.Component{
}
break
- case 'local':
+ default:
if (props.mopidy_connected){
if (props.artist && props.artist.images){
console.info('Loading local artist from index')
@@ -177,33 +177,52 @@ class Artist extends React.Component{
}
render(){
- if( !this.props.artist ) return null
var scheme = helpers.uriSource( this.props.params.uri );
- var image = null
- if( this.props.artist.images ) image = helpers.sizedImages( this.props.artist.images ).huge
+ if ( this.props.artist && this.props.artist.images ){
+ var image = helpers.sizedImages( this.props.artist.images ).huge
+ } else {
+ var image = null
+ }
- return (
-
+ if (this.props.artist){
+ return (
+
-
+
-
+
-
+
-
-
-
{ this.props.artist.name }
- { scheme == 'spotify' ?
: null}
- { this.renderSubViewMenu() }
+
+
+
{this.props.artist ? this.props.artist.name : null}
+ { scheme == 'spotify' ?
: null}
+ { this.renderSubViewMenu() }
+
+
+
+ {this.props.artist ? this.renderBody() : null}
+
+
+ );
+
+ } else {
+ return (
+
+
+
+
+
+
+
{this.props.params.uri}
+ { this.renderSubViewMenu() }
+
-
- { this.renderBody() }
-
-
- );
+ );
+ }
}
}
diff --git a/src/js/views/Playlist.js b/src/js/views/Playlist.js
index 3fabbb0d..7ead6218 100755
--- a/src/js/views/Playlist.js
+++ b/src/js/views/Playlist.js
@@ -46,7 +46,7 @@ class Playlist extends React.Component{
this.props.spotifyActions.getPlaylist( props.params.uri );
break
- case 'm3u':
+ default:
if( props.mopidy_connected ) this.props.mopidyActions.getPlaylist( props.params.uri );
break
@@ -128,48 +128,72 @@ class Playlist extends React.Component{
}
render(){
- if( !this.props.playlist || !this.props.playlist.name ) return null
- var scheme = helpers.uriSource( this.props.playlist.uri )
-
+ var scheme = helpers.uriSource( this.props.params.uri )
var context = 'playlist-track'
- if (this.props.playlist.can_edit) context = 'editable-playlist-track'
- return (
-
-
-
+ if (this.props.playlist){
+ if (this.props.playlist.can_edit) context = 'editable-playlist-track'
-
+ return (
+
+
+
-
-
-
{helpers.uriSource( this.props.params.uri )} playlist
+
+
+
+
+ {helpers.uriSource( this.props.params.uri )} playlist
+
+
{ this.props.playlist.name }
+ { this.props.playlist.description ?
: null }
+
+
+ { this.props.playlist.owner ? - {this.props.playlist.owner.id}
: null }
+
+ { this.props.playlist.followers ? - {this.props.playlist.followers.total.toLocaleString()} followers
: null }
+
+ { this.props.playlist.last_modified ? : null }
+
+ -
+ { this.props.playlist.tracks_total ? this.props.playlist.tracks_total : '0'} tracks,
+ { this.props.playlist.tracks ? : '0 mins' }
+
+
-
{ this.props.playlist.name }
- { this.props.playlist.description ?
: null }
-
- { this.props.playlist.owner ? - {this.props.playlist.owner.id}
: null }
+ { this.renderActions() }
- { this.props.playlist.followers ? - {this.props.playlist.followers.total.toLocaleString()} followers
: null }
-
- { this.props.playlist.last_modified ? : null }
-
- -
- { this.props.playlist.tracks_total ? this.props.playlist.tracks_total : '0'} tracks,
- { this.props.playlist.tracks ? : '0 mins' }
-
-
+
+ { this.props.playlist.tracks ? this.removeTracks(tracks_indexes) } reorderTracks={ (indexes, index) => this.reorderTracks(indexes, index) } /> : null }
+ this.loadMore() }/>
+
+ )
- { this.renderActions() }
-
-
- { this.props.playlist.tracks ? this.removeTracks(tracks_indexes) } reorderTracks={ (indexes, index) => this.reorderTracks(indexes, index) } /> : null }
- this.loadMore() }/>
-
-
- )
+ } else {
+ return (
+
+
+
+
+
+ {helpers.uriSource( this.props.params.uri )} playlist
+
+
{ this.props.params.uri }
+
+ -
+ 0 tracks,
+ 0 mins
+
+
+
+
+
+
+
+ )
+ }
}
}
diff --git a/src/js/views/Queue.js b/src/js/views/Queue.js
index e74b7f03..3833950f 100755
--- a/src/js/views/Queue.js
+++ b/src/js/views/Queue.js
@@ -21,7 +21,7 @@ import * as mopidyActions from '../services/mopidy/actions'
class Queue extends React.Component{
constructor(props) {
- super(props);
+ super(props)
}
removeTracks( tracks_indexes ){
@@ -59,6 +59,10 @@ class Queue extends React.Component{
render(){
var actions = (
+