fix: last commit (xd)

This commit is contained in:
2023-12-31 05:13:08 +01:00
parent 40dd7cbcee
commit 81c59ea2a7
4 changed files with 35 additions and 38 deletions
+14 -9
View File
@@ -21,21 +21,26 @@ export default async function handler(
) {
try {
const song = await spotify.getCurrentSong()
if (!song || !song.isPlaying) {
if (!song.is_playing) {
return res.status(200).json({
nowplaying: false,
is_playing: false,
})
}
res.status(200).json({
nowplaying: true,
song: {
artist: song.artists.name,
title: song.title,
url: song.url,
is_playing: true,
album: {
name: song.album.name,
image: song.album.image,
progress: song.progress,
length: song.length,
release: song.album.release,
},
artists: {
name: song.artists.name,
url: song.artists.url,
},
url: song.url,
title: song.title,
progress: song.progress,
duration: song.duration,
})
} catch (error) {
res