Fixed timestamp & duration of scrobble. 100% playback automatically scrobbles the song.

This commit is contained in:
Tom
2024-12-05 20:27:09 +00:00
parent 0bfbc36952
commit 934689763b
2 changed files with 15 additions and 9 deletions

View File

@ -23,7 +23,7 @@ class MalojaScrobbler {
return this.#config.name;
}
async scrobble(song, progress, start) {
async scrobble(song, duration, start) {
const url = new URL(this.#config.url);
url.pathname += "/apis/mlj_1/newscrobble";
url.search = "?key=" + this.#config.token;
@ -31,9 +31,9 @@ class MalojaScrobbler {
title: song.name,
album: song.album,
artists: song.artists,
duration: Math.round(progress / 1000),
duration: Math.round(duration / 1000),
length: Math.round(song.duration / 1000),
//time: start
time: Math.round(start / 1000)
});
this.#counter++;