Standardizing bracket syntax

This commit is contained in:
James Barnsley
2017-10-10 13:05:28 +13:00
parent 0ca37b0f62
commit 2ffa337ffa
116 changed files with 7451 additions and 3246 deletions

View File

@ -23,7 +23,7 @@ import * as spotifyActions from '../services/spotify/actions'
class Playlist extends React.Component{
constructor(props) {
constructor(props){
super(props);
}
@ -31,12 +31,12 @@ class Playlist extends React.Component{
this.loadPlaylist();
}
componentWillReceiveProps( nextProps ){
if( nextProps.params.uri != this.props.params.uri ){
this.loadPlaylist( nextProps )
}else if( !this.props.mopidy_connected && nextProps.mopidy_connected ){
if( helpers.uriSource( this.props.params.uri ) != 'spotify' ){
this.loadPlaylist( nextProps )
componentWillReceiveProps(nextProps){
if (nextProps.params.uri != this.props.params.uri){
this.loadPlaylist(nextProps )
}else if (!this.props.mopidy_connected && nextProps.mopidy_connected){
if (helpers.uriSource(this.props.params.uri ) != 'spotify'){
this.loadPlaylist(nextProps )
}
}
}
@ -57,15 +57,15 @@ class Playlist extends React.Component{
console.info('Loading playlist from index')
} else {
switch (helpers.uriSource( props.params.uri)){
switch (helpers.uriSource(props.params.uri)){
case 'spotify':
this.props.spotifyActions.getPlaylist( props.params.uri )
this.props.spotifyActions.getPlaylist(props.params.uri )
break
default:
if (props.mopidy_connected){
this.props.mopidyActions.getPlaylist( props.params.uri )
this.props.mopidyActions.getPlaylist(props.params.uri )
}
break
}
@ -73,7 +73,7 @@ class Playlist extends React.Component{
}
loadMore(){
this.props.spotifyActions.getURL( this.props.playlist.tracks_more, 'PLAYLIST_LOADED_MORE_TRACKS', this.props.playlist.uri );
this.props.spotifyActions.getURL(this.props.playlist.tracks_more, 'PLAYLIST_LOADED_MORE_TRACKS', this.props.playlist.uri );
}
play(){
@ -88,20 +88,20 @@ class Playlist extends React.Component{
// TODO: Once unfollowing occurs, remove playlist from global playlists list
unfollow(){
ReactGA.event({ category: 'Playlist', action: 'Unfollow', label: this.props.playlist.uri })
this.props.spotifyActions.toggleFollowingPlaylist( this.props.playlist.uri, 'DELETE' )
this.props.spotifyActions.toggleFollowingPlaylist(this.props.playlist.uri, 'DELETE' )
}
// TODO: Once deletion occurs, remove playlist from global playlists list
delete(){
this.props.mopidyActions.deletePlaylist( this.props.playlist.uri )
this.props.mopidyActions.deletePlaylist(this.props.playlist.uri )
}
reorderTracks( indexes, index ){
this.props.coreActions.reorderPlaylistTracks( this.props.playlist.uri, indexes, index, this.props.playlist.snapshot_id )
reorderTracks(indexes, index){
this.props.coreActions.reorderPlaylistTracks(this.props.playlist.uri, indexes, index, this.props.playlist.snapshot_id )
}
removeTracks( tracks_indexes ){
this.props.coreActions.removeTracksFromPlaylist( this.props.playlist.uri, tracks_indexes )
removeTracks(tracks_indexes){
this.props.coreActions.removeTracksFromPlaylist(this.props.playlist.uri, tracks_indexes )
}
inLibrary(){
@ -110,7 +110,7 @@ class Playlist extends React.Component{
}
renderActions(){
switch( helpers.uriSource( this.props.playlist.uri ) ){
switch(helpers.uriSource(this.props.playlist.uri )){
case 'm3u':
return (
@ -122,7 +122,7 @@ class Playlist extends React.Component{
)
case 'spotify':
if( this.props.playlist.can_edit ){
if (this.props.playlist.can_edit){
return (
<div className="actions">
<button className="primary" onClick={ e => this.play() }>Play</button>
@ -152,7 +152,7 @@ class Playlist extends React.Component{
render(){
if (!this.props.playlist) return null
var scheme = helpers.uriSource( this.props.params.uri )
var scheme = helpers.uriSource(this.props.params.uri )
var context = 'playlist'
if (this.props.playlist.can_edit) context = 'editable-playlist'
var user_id = helpers.getFromUri('userid',this.props.params.uri)
@ -180,7 +180,7 @@ class Playlist extends React.Component{
{ this.props.playlist.description ? <h2 className="description grey-text" dangerouslySetInnerHTML={{__html: this.props.playlist.description}}></h2> : null }
<ul className="details">
{ !this.props.slim_mode ? <li className="has-tooltip"><FontAwesome name={helpers.sourceIcon( this.props.params.uri )} /><span className="tooltip">{helpers.uriSource( this.props.params.uri )} playlist</span></li> : null }
{ !this.props.slim_mode ? <li className="has-tooltip"><FontAwesome name={helpers.sourceIcon(this.props.params.uri )} /><span className="tooltip">{helpers.uriSource(this.props.params.uri )} playlist</span></li> : null }
{ this.props.playlist.owner && !this.props.slim_mode ? <li><Link to={'/user/'+this.props.playlist.owner.uri}>{this.props.playlist.owner.id}</Link></li> : null }
{ this.props.playlist.followers ? <li>{this.props.playlist.followers.total.toLocaleString()} followers</li> : null }
{ this.props.playlist.last_modified ? <li><Dater type="ago" data={this.props.playlist.last_modified} /></li> : null }