From ac1647bbe5a44b76657659381bd95e3607b70fc4 Mon Sep 17 00:00:00 2001 From: John Corser Date: Thu, 17 Dec 2020 18:39:39 -0500 Subject: [PATCH] fall back to recent song when listening to a podcast --- api/spotify.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/spotify.py b/api/spotify.py index d0abdd1..5d0e040 100644 --- a/api/spotify.py +++ b/api/spotify.py @@ -39,7 +39,7 @@ def refreshToken(): headers = {"Authorization": "Basic {}".format(getAuth())} response = requests.post(REFRESH_TOKEN_URL, data=data, headers=headers) - + try: return response.json()["access_token"] except KeyError: @@ -92,7 +92,7 @@ def makeSVG(data): contentBar = "".join(["
" for i in range(barCount)]) barCSS = barGen(barCount) - if data == {} or data["item"] == "None": + if data == {} or data["item"] == "None" or data["item"] is None: # contentBar = "" #Shows/Hides the EQ bar if no song is currently playing currentStatus = "Was playing:" recentPlays = recentlyPlayed()