From 949f528ac8e1ec4e5732116f0bcdef725aa648e6 Mon Sep 17 00:00:00 2001 From: Reasine Marcet Date: Sun, 25 Feb 2018 21:28:06 -0800 Subject: [PATCH] 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) --- nowplaying.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nowplaying.py b/nowplaying.py index bae1979..5b67001 100644 --- a/nowplaying.py +++ b/nowplaying.py @@ -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: