mirror of
https://github.com/skidoodle/albert.lol.git
synced 2025-02-15 06:09:15 +01:00
nem is spotify hanem lastfm
This commit is contained in:
parent
af344d5fcd
commit
2b6124cbf9
2 changed files with 18 additions and 8 deletions
|
@ -13,7 +13,7 @@ export default async function(req: NextApiRequest, res: NextApiResponse) {
|
||||||
let nowplaying = Boolean(track[0]['@attr']?.nowplaying)
|
let nowplaying = Boolean(track[0]['@attr']?.nowplaying)
|
||||||
|
|
||||||
if(nowplaying) {
|
if(nowplaying) {
|
||||||
res.status(200).json({
|
return res.status(200).json({
|
||||||
nowplaying,
|
nowplaying,
|
||||||
song: {
|
song: {
|
||||||
artist: artist['#text'],
|
artist: artist['#text'],
|
||||||
|
@ -24,5 +24,5 @@ export default async function(req: NextApiRequest, res: NextApiResponse) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
res.status(200).json({ nowplaying })
|
return res.status(200).json({ nowplaying })
|
||||||
}
|
}
|
|
@ -1,14 +1,16 @@
|
||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
|
import Link from 'next/link'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import { socials } from 'components/data/socials'
|
import { socials } from 'components/data/socials'
|
||||||
|
|
||||||
import { Icon } from 'components/Icon'
|
import { Icon } from 'components/Icon'
|
||||||
import { Toaster } from 'react-hot-toast'
|
|
||||||
import { GetServerSideProps } from 'next'
|
|
||||||
import { FaSpotify } from 'react-icons/fa'
|
|
||||||
import { Footer } from 'components/Footer'
|
import { Footer } from 'components/Footer'
|
||||||
|
|
||||||
|
import { Toaster } from 'react-hot-toast'
|
||||||
|
import { FaSpotify } from 'react-icons/fa'
|
||||||
|
|
||||||
|
import { GetServerSideProps } from 'next'
|
||||||
|
|
||||||
export default function({ spotify }: any) {
|
export default function({ spotify }: any) {
|
||||||
return(
|
return(
|
||||||
<>
|
<>
|
||||||
|
@ -29,7 +31,15 @@ export default function({ spotify }: any) {
|
||||||
<FaSpotify className='text-[#32a866]' />
|
<FaSpotify className='text-[#32a866]' />
|
||||||
|
|
||||||
<p className='font-semibold'>Listening to
|
<p className='font-semibold'>Listening to
|
||||||
<span className='text-[#32a866]'> { spotify.song?.artist - spotify.song?.title || 'nothing' }</span>
|
{
|
||||||
|
spotify.song
|
||||||
|
? <Link href={`${spotify.song.url}`}>
|
||||||
|
<a className='text-[#32a866]'> { spotify.song.artist + ' - ' + spotify.song.title }</a>
|
||||||
|
</Link>
|
||||||
|
|
||||||
|
: <a className='text-[#32a866]'> nothing</a>
|
||||||
|
}
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue