From 2bad02d27e3f652a7cd9fe12c65edaaf08e28dd8 Mon Sep 17 00:00:00 2001 From: Neshura Date: Mon, 22 Apr 2024 20:07:03 +0200 Subject: [PATCH] Move song data to currentSong.data --- src/routes/+page.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 03bba3b..80ecc13 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -49,10 +49,12 @@ let source: HTMLAudioElement = $state(); let mode = $state(new PlaybackState()); let title = $state(""); + let artist = $state(""); let queueIndex = $state(0); let currentSong = $state({ data: { title, + artist }, queueIndex }); @@ -122,7 +124,7 @@ play(); } - function newSong(song: number) { + function newSong(song: unknown) { let parameters = [ { parameter: "id", value: song.id }, //{ parameter: "maxBitRate", value: } // TODO @@ -134,6 +136,7 @@ ]; let url = OpenSubsonic.getApiUrl("stream", parameters); source = new Audio(url); // Assign new URL + currentSong.data = song; // Reassign Event Handlers source.onloadedmetadata = () => {