Skip to content

Commit

Permalink
fix(lastfm): remove clearing of currentSong
Browse files Browse the repository at this point in the history
  • Loading branch information
sogehige committed Nov 14, 2021
1 parent ff7be56 commit 8e80487
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/integrations/lastfm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class LastFM extends Integration {
const response = await axios.get<any>(`http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=${this.username}&api_key=${this.apiKey}&format=json`);
const tracks = response.data.recenttracks.track;

this.currentSong = null;
for (const track of tracks) {
if (track['@attr'] && track['@attr'].nowplaying === 'true') {
const song = `${track.name} - ${track.artist['#text']}`;
Expand All @@ -54,7 +53,6 @@ class LastFM extends Integration {
this.currentSong = song;
}
}

} catch(e: any) {
if (e.isAxiosError) {
if (e.response.data.error === 8) {
Expand Down

0 comments on commit 8e80487

Please sign in to comment.