Send the time the track started playing when scrobbling

This commit is contained in:
Deluan
2021-06-23 09:19:58 -04:00
committed by Deluan Quintão
parent 056f0b944f
commit f4ddd201f2
2 changed files with 16 additions and 6 deletions
+10 -2
View File
@@ -22,8 +22,15 @@ const url = (command, id, options) => {
return `/rest/${command}?${params.toString()}`
}
const scrobble = (id, submit) =>
httpClient(url('scrobble', id, { submission: submit }))
const scrobble = (id, submission = false, time) =>
httpClient(
url('scrobble', id, {
...(submission && time && { time }),
submission,
})
)
const nowPlaying = (id) => scrobble(id, false)
const star = (id) => httpClient(url('star', id))
@@ -52,6 +59,7 @@ const streamUrl = (id) => {
export default {
url,
scrobble,
nowPlaying,
download,
star,
unstar,