Skip to content

Commit

Permalink
final checks lastfm
Browse files Browse the repository at this point in the history
  • Loading branch information
sneljo1 committed Mar 16, 2019
1 parent 3f69655 commit 41cf3c5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main/features/core/lastFm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class LastFm extends Feature {
config: { lastfm }
} = currentState;

if (playingTrack && lastfm) {
if (playingTrack && lastfm && lastfm.key) {
const trackId = playingTrack.id;
const track = getTrackEntity(trackId)(currentState);

Expand Down Expand Up @@ -88,7 +88,7 @@ export default class LastFm extends Feature {

const trackId = args[0];

if (trackId && lastfm) {
if (trackId && lastfm && lastfm.key) {
const track = getTrackEntity(trackId)(currentState);

if (track) {
Expand All @@ -115,7 +115,7 @@ export default class LastFm extends Feature {
} = currentState;


if (playingTrack && lastfm) {
if (playingTrack && lastfm && lastfm.key) {
const trackId = playingTrack.id;
const track = getTrackEntity(trackId)(currentState);

Expand Down Expand Up @@ -149,6 +149,8 @@ export default class LastFm extends Feature {

const session = await this.getLastFMSession();

if (!session) return;

this.logger.debug('nowplaying : ' + title + ' - ' + artist);

this.lastfm
Expand All @@ -169,6 +171,8 @@ export default class LastFm extends Feature {

const session = await this.getLastFMSession();

if (!session) return;

this.logger.debug(`track.${liked ? 'love' : 'unlove'}` + ' : ' + title + ' - ' + artist);

this.lastfm
Expand All @@ -189,6 +193,8 @@ export default class LastFm extends Feature {

const session = await this.getLastFMSession();

if (!session) return;

this.logger.debug('scrobble : ' + title + ' - ' + artist);

this.lastfm
Expand Down Expand Up @@ -269,7 +275,6 @@ export default class LastFm extends Feature {
return this.lastfm.session(lastfmConfig.user, lastfmConfig.key);
} else if (newSession) {
return this.newSession();

}

} catch (err) {
Expand Down

0 comments on commit 41cf3c5

Please sign in to comment.