Skip to content

Commit

Permalink
Don't print the same song repeatedly in the console window
Browse files Browse the repository at this point in the history
  • Loading branch information
vsTerminus committed Mar 2, 2021
1 parent f0730b9 commit 6fb2ba3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Discord/NP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ has 'lastfm_user' => ( is => 'ro' );
has 'lastfm_key' => ( is => 'ro' );
has 'lastfm' => ( is => 'lazy', builder => sub { Mojo::WebService::LastFM->new( api_key => shift->lastfm_key ) } );
has 'my_id' => ( is => 'rw' );
has 'last_status' => ( is => 'rw' );
has 'last_status' => ( is => 'rw', default => '' );
has 'show_artist' => ( is => 'ro' );
has 'show_title' => ( is => 'ro' );

Expand Down Expand Up @@ -75,7 +75,7 @@ sub update_status
'state' => $json->{'album'}
});

say localtime(time) . " - Now Playing: $nowplaying";
say localtime(time) . " - Now Playing: $nowplaying" unless $nowplaying eq $self->last_status;
$self->last_status($nowplaying);
}
else
Expand Down

0 comments on commit 6fb2ba3

Please sign in to comment.