From 6589de9aa7baf4726382c8edab746b25f99ade73 Mon Sep 17 00:00:00 2001 From: skidoodle <53189968+skidoodle@users.noreply.github.com> Date: Tue, 25 Oct 2022 14:24:51 +0200 Subject: [PATCH] Update spotify.ts Signed-off-by: skidoodle <53189968+skidoodle@users.noreply.github.com> --- pages/api/spotify.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/api/spotify.ts b/pages/api/spotify.ts index e315975..4f68c39 100644 --- a/pages/api/spotify.ts +++ b/pages/api/spotify.ts @@ -6,7 +6,7 @@ export default async function (req: NextApiRequest, res: NextApiResponse) { const spotify = new SpotifyService(CLIENT_ID!, CLIENT_SECRET!, REFRESH_TOKEN!) const song = await spotify.getCurrentSong() - if(!song || !song.isPlaying ) { + if(!song.error || !song.isPlaying ) { return res.status(200).json({ nowplaying: false, }); @@ -20,4 +20,4 @@ export default async function (req: NextApiRequest, res: NextApiResponse) { url: song.externalUrl, } }); -} \ No newline at end of file +}