diff --git a/src/lib/components/Intro.svelte b/src/lib/components/Intro.svelte index 583d2ef..e46bb46 100644 --- a/src/lib/components/Intro.svelte +++ b/src/lib/components/Intro.svelte @@ -30,7 +30,14 @@ {/each}
- + {#if data.song.isPlaying} + + + Now Playing: + {data.song.artist} - {data.song.title} + + + {/if}
diff --git a/src/lib/components/NowPlaying.svelte b/src/lib/components/NowPlaying.svelte deleted file mode 100644 index 1ee3619..0000000 --- a/src/lib/components/NowPlaying.svelte +++ /dev/null @@ -1,14 +0,0 @@ - - -{#if song.isPlaying} - - - Now Playing: - {song.artist} - {song.title} - - -{/if} diff --git a/src/routes/api/spotify/np/+server.ts b/src/routes/api/spotify/np/+server.ts index 368f574..ab2a041 100644 --- a/src/routes/api/spotify/np/+server.ts +++ b/src/routes/api/spotify/np/+server.ts @@ -27,13 +27,13 @@ export async function GET() { let artist = song.item.artists.map((_artist: Artist) => _artist.name).join(', '); const songUrl = song.item.external_urls.spotify; - // trim artist and song names - if (artist.length > 15) { - artist = artist.substring(0, 15) + '...'; - } - if (title.length > 25) { - title = title.substring(0, 25) + '...'; - } + // trim artist and song names + if (artist.length > 15) { + artist = artist.substring(0, 15) + '...'; + } + if (title.length > 25) { + title = title.substring(0, 25) + '...'; + } return new Response( JSON.stringify({