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)
|
||||
|
||||
if(nowplaying) {
|
||||
res.status(200).json({
|
||||
return res.status(200).json({
|
||||
nowplaying,
|
||||
song: {
|
||||
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 Link from 'next/link'
|
||||
import React from 'react'
|
||||
|
||||
import { socials } from 'components/data/socials'
|
||||
|
||||
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 { Toaster } from 'react-hot-toast'
|
||||
import { FaSpotify } from 'react-icons/fa'
|
||||
|
||||
import { GetServerSideProps } from 'next'
|
||||
|
||||
export default function({ spotify }: any) {
|
||||
return(
|
||||
<>
|
||||
|
@ -28,8 +30,16 @@ export default function({ spotify }: any) {
|
|||
<div className='mt-3 flex justify-center items-center'>
|
||||
<FaSpotify className='text-[#32a866]' />
|
||||
|
||||
<p className='font-semibold'>Listening to
|
||||
<span className='text-[#32a866]'> { spotify.song?.artist - spotify.song?.title || 'nothing' }</span>
|
||||
<p className='font-semibold'>Listening to
|
||||
{
|
||||
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>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue