diff --git a/src/components/playing/NowPlaying.astro b/src/components/playing/NowPlaying.astro index 19ed956..4993650 100644 --- a/src/components/playing/NowPlaying.astro +++ b/src/components/playing/NowPlaying.astro @@ -1,46 +1,188 @@ --- import { spotifyNowPlaying, SpotifyError } from "./spotify"; +import mp3Base from "/assets/mp3/base.png"; +import mp3AlbumArtMask from "/assets/mp3/album-art-mask.png"; +import mp3RecordCircle from "/assets/mp3/record-circle.png"; +import mp3HeadCircle from "/assets/mp3/head-circle.png"; +import mp3PlaybackHead from "/assets/mp3/playback-head.png"; + const track = await spotifyNowPlaying().catch((err) => { if (!(err instanceof SpotifyError)) throw new Error("Unhandled exception"); - console.error(err.code, err.human, err.details); - if (err.code === "NO_CONTENT") return null; + + console.error(err.code, err.human, err.details); return err; }); --- -
- { - track ? ( - !(track instanceof SpotifyError) ? ( - <> - Now playing: - b.width + b.height - (a.width + a.height), - )[0].url - } - alt="" - /> - {track.name} by {track.artists.map((x) => x.name).join(",")} - - ) : ( - <> - Error occurred {track.code} - {track.human}
- - {JSON.stringify(track.details)} - - } + + +