From a99e12c6e6b373e478c7e547427c1a083156cd9a Mon Sep 17 00:00:00 2001 From: Neshura Date: Mon, 22 Apr 2024 20:08:08 +0200 Subject: [PATCH] Include Scrobble --- src/routes/+page.svelte | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 794d55d..d2dad6d 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -144,9 +144,17 @@ duration = currentSong.source.duration; }; - source.onplay = () => { - source.volume = volume; - isPaused = source.paused; + currentSong.source.onplay = () => { + currentSong.source.volume = volume; + isPaused = currentSong.source.paused; + let time: number = Date.now(); + let parameters = [ + { parameter: "id", value: song.id }, + { parameter: "time", value: time}, + { parameter: "submission", value: false} + ]; + console.warn("Scrobble is disabled"); + OpenSubsonic.get("scrobble", parameters); } currentSong.source.onpause = () => {