uses last-played song instead of "now playing" song

downside: will re(post) the last song you listened to on startup
upside: works with scrobblers that don't set the now-playing value correctly (which seems to include manual web scrobblers)
This commit is contained in:
Reasine Marcet 2018-02-25 21:28:06 -08:00
parent 4113baa3e1
commit 949f528ac8

View file

@ -32,7 +32,7 @@ class NowplayingBot(PineappleBot):
@interval(30)
def post_np(self):
# grab the track from the last.fm api
currently_playing = self.lastfm.get_user(self.config.lastfm_username).get_now_playing()
currently_playing = self.lastfm.get_user(self.config.lastfm_username).get_recent_tracks(1)[0][0]
# don't try to post if nothing is being played
if currently_playing is None: