Don't send invalid scrobbles when clearing the player's queue

This commit is contained in:
Deluan 2021-07-26 16:50:45 -04:00
parent fb4eefced5
commit e68b22ea5d
2 changed files with 3 additions and 3 deletions

View File

@ -103,7 +103,7 @@ const Player = () => {
}
if (!scrobbled) {
subsonic.scrobble(info.trackId, true, startTime)
info.trackId && subsonic.scrobble(info.trackId, startTime)
setScrobbled(true)
}
},

View File

@ -22,7 +22,7 @@ const url = (command, id, options) => {
return `/rest/${command}?${params.toString()}`
}
const scrobble = (id, submission = false, time) =>
const scrobble = (id, time, submission = true) =>
httpClient(
url('scrobble', id, {
...(submission && time && { time }),
@ -30,7 +30,7 @@ const scrobble = (id, submission = false, time) =>
})
)
const nowPlaying = (id) => scrobble(id, false)
const nowPlaying = (id) => scrobble(id, null, false)
const star = (id) => httpClient(url('star', id))