Skip to content

Commit

Permalink
Code quality = != to !==
Browse files Browse the repository at this point in the history
  • Loading branch information
trekiteasy committed Jan 21, 2019
1 parent e82a02e commit 25763dd
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions app/components/AlbumView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ class AlbumView extends React.Component {
super(props);
}

getArtistName(track, album) {
getArtistName (track, album) {
if (!track.artists) {
return album.artists[0].name;
} else {
let firstArtist = _.find(track.artists, artist => artist.join === '')
.name;
let artistName = firstArtist;
_(track.artists)
.filter(artist => artist.name != firstArtist)
.filter(artist => artist.name !== firstArtist)
.forEach(artist => {
artistName += ' ' + artist.join + ' ' + artist.name;
});
Expand All @@ -30,15 +30,15 @@ class AlbumView extends React.Component {
}
}

addToQueue(album, track) {
addToQueue (album, track) {
this.props.addToQueue(this.props.musicSources, {
artist: this.getArtistName(track, album),
name: track.title,
thumbnail: album.images[0].uri
});
}

addAlbumToQueue(album) {
addAlbumToQueue (album) {
album.tracklist.map((track, i) => {
this.props.addToQueue(this.props.musicSources, {
artist: album.artists[0].name,
Expand All @@ -48,19 +48,19 @@ class AlbumView extends React.Component {
});
}

artistInfoSearch(artistId) {
artistInfoSearch (artistId) {
this.props.artistInfoSearch(artistId);
this.props.history.push('/artist/' + artistId);
}

playAll(album) {
playAll (album) {
this.props.clearQueue();
this.addAlbumToQueue(album);
this.props.selectSong(0);
this.props.startPlayback();
}

render() {
render () {
let { album } = this.props;
if (_.some(_.map([album.images, album.artists, album.genres], _.isEmpty))) {
return this.renderInvalidData();
Expand All @@ -69,7 +69,7 @@ class AlbumView extends React.Component {
return this.renderAlbumLoading(album, albumImage);
}

renderInvalidData() {
renderInvalidData () {
return (
<div>
<h3>Discogs returned invalid data.</h3>
Expand All @@ -78,7 +78,7 @@ class AlbumView extends React.Component {
);
}

getAlbumImage(album) {
getAlbumImage (album) {
let albumImage = _.find(album.images, { type: 'primary' });
if (!albumImage) {
albumImage = album.images ? album.images[0].uri : artPlaceholder;
Expand All @@ -88,7 +88,7 @@ class AlbumView extends React.Component {
return albumImage;
}

renderAlbumArtistName(album) {
renderAlbumArtistName (album) {
return (
<div className={styles.album_artist}>
by{' '}
Expand All @@ -104,7 +104,7 @@ class AlbumView extends React.Component {
);
}

renderAlbumGenre(album) {
renderAlbumGenre (album) {
return (
<div className={styles.album_genre}>
<label>Genre:</label>
Expand All @@ -113,7 +113,7 @@ class AlbumView extends React.Component {
);
}

renderPlayAllButton(album) {
renderPlayAllButton (album) {
return (
<a
onClick={() => this.playAll(album)}
Expand All @@ -125,7 +125,7 @@ class AlbumView extends React.Component {
);
}

renderAlbumYear(album) {
renderAlbumYear (album) {
return (
<div className={styles.album_year}>
<label>Year:</label>
Expand All @@ -134,7 +134,7 @@ class AlbumView extends React.Component {
);
}

renderAlbumTracksCount(album) {
renderAlbumTracksCount (album) {
return (
<div className={styles.album_tracks}>
<label>Tracks:</label>
Expand All @@ -143,7 +143,7 @@ class AlbumView extends React.Component {
);
}

renderAlbumInfoBox(album, albumImage) {
renderAlbumInfoBox (album, albumImage) {
return (
<div className={styles.album_info_box}>
<img src={albumImage} />
Expand All @@ -162,7 +162,7 @@ class AlbumView extends React.Component {
);
}

renderAlbumLoading(album, albumImage) {
renderAlbumLoading (album, albumImage) {
return (
<div className={styles.album_view_container}>
<Dimmer.Dimmable>
Expand All @@ -180,7 +180,7 @@ class AlbumView extends React.Component {
);
}

renderAlbumTracksList(album) {
renderAlbumTracksList (album) {
return (
<table className={styles.album_tracklist}>
<thead>
Expand All @@ -203,7 +203,7 @@ class AlbumView extends React.Component {
);
}

renderContextPopup(album, el, i) {
renderContextPopup (album, el, i) {
return (
<ContextPopup
key={i}
Expand All @@ -224,7 +224,7 @@ class AlbumView extends React.Component {
);
}

renderPlayTrackButton(album, el) {
renderPlayTrackButton (album, el) {
return (
<a
href='#'
Expand All @@ -242,7 +242,7 @@ class AlbumView extends React.Component {
);
}

renderAddTrackToQueueButton(album, el) {
renderAddTrackToQueueButton (album, el) {
return (
<a
href='#'
Expand All @@ -254,7 +254,7 @@ class AlbumView extends React.Component {
</a>
);
}
renderOptionsButtons(album) {
renderOptionsButtons (album) {
return (
<ContextPopup
trigger={
Expand Down

0 comments on commit 25763dd

Please sign in to comment.