mirror of
https://github.com/skidoodle/albert.lol.git
synced 2025-02-15 06:09:15 +01:00
Update spotify.ts
Signed-off-by: skidoodle <53189968+skidoodle@users.noreply.github.com>
This commit is contained in:
parent
505416d710
commit
6589de9aa7
1 changed files with 2 additions and 2 deletions
|
@ -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,
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue