Standardizing bracket syntax
This commit is contained in:
@ -21,7 +21,7 @@ import * as spotifyActions from '../../services/spotify/actions'
|
||||
|
||||
class LibraryAlbums extends React.Component{
|
||||
|
||||
constructor(props) {
|
||||
constructor(props){
|
||||
super(props)
|
||||
|
||||
this.state = {
|
||||
@ -95,7 +95,7 @@ class LibraryAlbums extends React.Component{
|
||||
}
|
||||
|
||||
loadMoreSpotify(){
|
||||
this.props.spotifyActions.getURL( this.props.library_albums_more, 'SPOTIFY_LIBRARY_ALBUMS_LOADED' );
|
||||
this.props.spotifyActions.getURL(this.props.library_albums_more, 'SPOTIFY_LIBRARY_ALBUMS_LOADED' );
|
||||
}
|
||||
|
||||
loadMoreMopidy(){
|
||||
@ -105,7 +105,7 @@ class LibraryAlbums extends React.Component{
|
||||
|
||||
setSort(value){
|
||||
var reverse = false
|
||||
if( this.props.sort == value ) reverse = !this.props.sort_reverse
|
||||
if (this.props.sort == value ) reverse = !this.props.sort_reverse
|
||||
|
||||
var data = {
|
||||
library_albums_sort_reverse: reverse,
|
||||
@ -117,7 +117,7 @@ class LibraryAlbums extends React.Component{
|
||||
renderView(albums){
|
||||
if (!albums || albums.length <= 0) return null
|
||||
|
||||
if( this.props.view == 'list' ){
|
||||
if (this.props.view == 'list'){
|
||||
var columns = [
|
||||
{
|
||||
label: 'Name',
|
||||
@ -148,11 +148,11 @@ class LibraryAlbums extends React.Component{
|
||||
className="album-list"
|
||||
link_prefix={global.baseURL+"album/"} />
|
||||
)
|
||||
}else if( this.props.view == 'detail' ){
|
||||
}else if (this.props.view == 'detail'){
|
||||
return (
|
||||
<div>
|
||||
{
|
||||
albums.map( album => {
|
||||
albums.map(album => {
|
||||
return (
|
||||
<div className="album" key={album.uri}>
|
||||
<Link to={global.baseURL+'album/'+album.uri}>
|
||||
|
||||
@ -18,7 +18,7 @@ import * as spotifyActions from '../../services/spotify/actions'
|
||||
|
||||
class LibraryArtists extends React.Component{
|
||||
|
||||
constructor(props) {
|
||||
constructor(props){
|
||||
super(props)
|
||||
|
||||
this.state = {
|
||||
@ -76,7 +76,7 @@ class LibraryArtists extends React.Component{
|
||||
|
||||
setSort(value){
|
||||
var reverse = false
|
||||
if( this.props.sort == value ) reverse = !this.props.sort_reverse
|
||||
if (this.props.sort == value ) reverse = !this.props.sort_reverse
|
||||
|
||||
var data = {
|
||||
library_artists_sort_reverse: reverse,
|
||||
@ -86,7 +86,7 @@ class LibraryArtists extends React.Component{
|
||||
}
|
||||
|
||||
renderView(artists){
|
||||
if( this.props.view == 'list' ){
|
||||
if (this.props.view == 'list'){
|
||||
var columns = [
|
||||
{
|
||||
label: 'Name',
|
||||
|
||||
@ -16,7 +16,7 @@ import * as spotifyActions from '../../services/spotify/actions'
|
||||
|
||||
class LibraryBrowse extends React.Component{
|
||||
|
||||
constructor(props) {
|
||||
constructor(props){
|
||||
super(props);
|
||||
}
|
||||
|
||||
@ -24,20 +24,20 @@ class LibraryBrowse extends React.Component{
|
||||
this.loadDirectory()
|
||||
}
|
||||
|
||||
componentWillReceiveProps( nextProps ){
|
||||
componentWillReceiveProps(nextProps){
|
||||
|
||||
// mopidy goes online
|
||||
if (!this.props.mopidy_connected && nextProps.mopidy_connected ){
|
||||
this.loadDirectory( nextProps );
|
||||
if (!this.props.mopidy_connected && nextProps.mopidy_connected){
|
||||
this.loadDirectory(nextProps );
|
||||
}
|
||||
|
||||
// our uri changes
|
||||
if (nextProps.params.uri != this.props.params.uri){
|
||||
this.loadDirectory( nextProps );
|
||||
this.loadDirectory(nextProps );
|
||||
}
|
||||
}
|
||||
|
||||
loadDirectory( props = this.props ){
|
||||
loadDirectory(props = this.props){
|
||||
if (props.mopidy_connected){
|
||||
var uri = null
|
||||
if (typeof(props.params.uri) !== 'undefined'){
|
||||
@ -48,13 +48,13 @@ class LibraryBrowse extends React.Component{
|
||||
}
|
||||
}
|
||||
|
||||
arrange_directory( directory ){
|
||||
arrange_directory(directory){
|
||||
var folders = []
|
||||
var tracks = []
|
||||
|
||||
for (var i = 0; i < directory.length; i++) {
|
||||
if (directory[i].type && directory[i].type == 'track') {
|
||||
tracks.push( directory[i] )
|
||||
for (var i = 0; i < directory.length; i++){
|
||||
if (directory[i].type && directory[i].type == 'track'){
|
||||
tracks.push(directory[i] )
|
||||
} else {
|
||||
var uri = directory[i].uri
|
||||
|
||||
@ -95,15 +95,15 @@ class LibraryBrowse extends React.Component{
|
||||
render(){
|
||||
if (typeof(this.props.params.uri) !== 'undefined' && this.props.params.uri){
|
||||
|
||||
var title = 'Browse'
|
||||
var uri_exploded = this.props.params.uri.split(':')
|
||||
var title = 'Browse';
|
||||
var uri_exploded = this.props.params.uri.split(':');
|
||||
if (uri_exploded.length > 0){
|
||||
title = uri_exploded[0]
|
||||
title = title.charAt(0).toUpperCase() + title.slice(1)
|
||||
title = uri_exploded[0];
|
||||
title = title.charAt(0).toUpperCase() + title.slice(1);
|
||||
}
|
||||
|
||||
var options = null
|
||||
if (this.props.params.uri != 'local:directory' ){
|
||||
var options = null;
|
||||
if (this.props.params.uri != 'local:directory'){
|
||||
options = (
|
||||
<button className="no-hover" onClick={ () => window.history.back() }>
|
||||
<FontAwesome name="reply" />
|
||||
@ -123,7 +123,7 @@ class LibraryBrowse extends React.Component{
|
||||
)
|
||||
}
|
||||
|
||||
var items = this.arrange_directory( this.props.directory )
|
||||
var items = this.arrange_directory(this.props.directory )
|
||||
|
||||
return (
|
||||
<div className="view library-local-view">
|
||||
|
||||
@ -19,7 +19,7 @@ import * as spotifyActions from '../../services/spotify/actions'
|
||||
|
||||
class LibraryPlaylists extends React.Component{
|
||||
|
||||
constructor(props) {
|
||||
constructor(props){
|
||||
super(props)
|
||||
|
||||
this.state = {
|
||||
@ -77,7 +77,7 @@ class LibraryPlaylists extends React.Component{
|
||||
|
||||
setSort(value){
|
||||
var reverse = false
|
||||
if( this.props.sort == value ) reverse = !this.props.sort_reverse
|
||||
if (this.props.sort == value ) reverse = !this.props.sort_reverse
|
||||
|
||||
var data = {
|
||||
library_playlists_sort_reverse: reverse,
|
||||
|
||||
@ -14,7 +14,7 @@ import * as spotifyActions from '../../services/spotify/actions'
|
||||
|
||||
class LibraryTracks extends React.Component{
|
||||
|
||||
constructor(props) {
|
||||
constructor(props){
|
||||
super(props);
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ class LibraryTracks extends React.Component{
|
||||
}
|
||||
|
||||
loadMore(){
|
||||
this.props.spotifyActions.getURL( this.props.tracks_more, 'SPOTIFY_LIBRARY_TRACKS_LOADED_MORE' );
|
||||
this.props.spotifyActions.getURL(this.props.tracks_more, 'SPOTIFY_LIBRARY_TRACKS_LOADED_MORE' );
|
||||
}
|
||||
|
||||
render(){
|
||||
|
||||
Reference in New Issue
Block a user