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 454e609 commit 9372737
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
38 changes: 19 additions & 19 deletions app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import WindowControls from './components/WindowControls';
import VolumeControls from './components/VolumeControls';

class App extends React.Component {
togglePlayback() {
togglePlayback () {
if (
this.props.player.playbackStatus === Sound.status.PAUSED &&
this.props.scrobbling.lastFmScrobblingEnabled &&
Expand All @@ -64,7 +64,7 @@ class App extends React.Component {
this.props.actions.togglePlayback(this.props.player.playbackStatus);
}

nextSong() {
nextSong () {
this.props.actions.nextSong();
if (
this.props.scrobbling.lastFmScrobblingEnabled &&
Expand All @@ -81,13 +81,13 @@ class App extends React.Component {
}
}

componentWillMount() {
componentWillMount () {
this.props.actions.readSettings();
this.props.actions.lastFmReadSettings();
this.props.actions.createSearchPlugins(PluginConfig.plugins);
}

render() {
render () {
let { settings } = this.props;
let { toggleOption } = this.props.actions;
return (
Expand All @@ -107,7 +107,7 @@ class App extends React.Component {
);
}

renderNavBar() {
renderNavBar () {
return (
<Navbar className={styles.navbar}>
<SearchBoxContainer />
Expand All @@ -118,7 +118,7 @@ class App extends React.Component {
);
}

renderRightPanel(settings) {
renderRightPanel (settings) {
return (
<VerticalPanel
className={classnames(styles.right_panel, {
Expand All @@ -129,7 +129,7 @@ class App extends React.Component {
</VerticalPanel>
);
}
renderSidebarMenu(settings, toggleOption) {
renderSidebarMenu (settings, toggleOption) {
return (
<VerticalPanel
className={classnames(styles.left_panel, {
Expand Down Expand Up @@ -160,7 +160,7 @@ class App extends React.Component {
);
}

renderNavLink(name, icon, prettyName, settings) {
renderNavLink (name, icon, prettyName, settings) {
return (
<NavLink to={'/' + name} activeClassName={styles.active_nav_link}>
<SidebarMenuItem>
Expand All @@ -170,7 +170,7 @@ class App extends React.Component {
);
}

renderSidebarFooter(settings, toggleOption) {
renderSidebarFooter (settings, toggleOption) {
return (
<div className='sidebar_footer'>
<a
Expand All @@ -190,7 +190,7 @@ class App extends React.Component {
);
}

renderFooter(settings) {
renderFooter (settings) {
return (
<Footer className={styles.footer}>
<Seekbar
Expand All @@ -210,7 +210,7 @@ class App extends React.Component {
);
}

renderCover() {
renderCover () {
return (
<ui.Cover
cover={
Expand All @@ -223,33 +223,33 @@ class App extends React.Component {
);
}

getCurrentSongParameter(parameter) {
getCurrentSongParameter (parameter) {
return this.props.queue.queueItems[this.props.queue.currentSong]
? this.props.queue.queueItems[this.props.queue.currentSong][parameter]
: null;
}

renderTrackInfo() {
renderTrackInfo () {
return (
<TrackInfo
track={this.getCurrentSongParameter('name')}
artist={this.getCurrentSongParameter('artist')}
/>
);
}
renderPlayerControls() {
renderPlayerControls () {
return (
<PlayerControls
togglePlay={this.togglePlayback.bind(this)}
playing={this.props.player.playbackStatus == Sound.status.PLAYING}
playing={this.props.player.playbackStatus === Sound.status.PLAYING}
loading={this.props.player.playbackStreamLoading}
forward={this.nextSong.bind(this)}
back={this.props.actions.previousSong}
/>
);
}

renderVolumeControl(settings) {
renderVolumeControl (settings) {
return (
<VolumeControls
fill={this.props.player.volume + '%'}
Expand All @@ -260,7 +260,7 @@ class App extends React.Component {
);
}

renderNavbar() {
renderNavbar () {
return (
<Navbar className={styles.navbar}>
<SearchBoxContainer />
Expand All @@ -272,7 +272,7 @@ class App extends React.Component {
}
}

function mapStateToProps(state) {
function mapStateToProps (state) {
return {
queue: state.queue,
player: state.player,
Expand All @@ -281,7 +281,7 @@ function mapStateToProps(state) {
};
}

function mapDispatchToProps(dispatch) {
function mapDispatchToProps (dispatch) {
return {
actions: bindActionCreators(
Object.assign(
Expand Down
28 changes: 14 additions & 14 deletions app/rest/Discogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const userToken = 'QDUeFOZNwIwOePlxpVziEHzamhbIHUdfENAJTnLR';
const key = 'EZaGPpKGBbTkjwmpjmNY';
const secret = 'uluhDSPtelRtLUvjrvQhRBnNwpZMtkZq';

function addToken(query, first = false) {
function addToken (query, first = false) {
let newQuery = query + '&token=' + userToken;
if (first) {
return newQuery.replace('&', '?');
Expand All @@ -12,7 +12,7 @@ function addToken(query, first = false) {
}
}

function addKeys(query, first = false) {
function addKeys (query, first = false) {
let newQuery = query + '&key=' + key + '&secret=' + secret;
if (first) {
return newQuery.replace('&', '?');
Expand All @@ -21,7 +21,7 @@ function addKeys(query, first = false) {
}
}

function searchQuery(terms, count = 15) {
function searchQuery (terms, count = 15) {
// Strip # manually to prevent it being interpreted as anchor separator
terms = terms.replace('#', '');

Expand All @@ -30,35 +30,35 @@ function searchQuery(terms, count = 15) {
);
}

function searchArtists(terms, count = 15) {
function searchArtists (terms, count = 15) {
return fetch(searchQuery(terms, count) + '&type=artist');
}

function searchReleases(terms, count = 15) {
function searchReleases (terms, count = 15) {
return fetch(searchQuery(terms, count) + '&type=master');
}

function releaseInfo(releaseId, releaseType) {
if(releaseType == 'master'){
function releaseInfo (releaseId, releaseType) {
if (releaseType === 'master') {
return fetch(addToken(apiUrl + 'masters/' + releaseId, true));
}
else if(releaseType == 'release'){
else if (releaseType === 'release') {
return fetch(addToken(apiUrl + 'releases/' + releaseId, true));
}
}

function artistInfo(artistId) {
function artistInfo (artistId) {
return fetch(addToken(apiUrl + 'artists/' + artistId, true));
}

function artistReleases(artistId) {
function artistReleases (artistId) {
return fetch(
addToken(
apiUrl +
'artists/' +
artistId +
'/releases' +
'?sort=year&sort_order=desc',
'artists/' +
artistId +
'/releases' +
'?sort=year&sort_order=desc',
false
)
);
Expand Down

0 comments on commit 9372737

Please sign in to comment.