Don't send invalid scrobbles when clearing the player's queue
This commit is contained in:
@@ -103,7 +103,7 @@ const Player = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!scrobbled) {
|
if (!scrobbled) {
|
||||||
subsonic.scrobble(info.trackId, true, startTime)
|
info.trackId && subsonic.scrobble(info.trackId, startTime)
|
||||||
setScrobbled(true)
|
setScrobbled(true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const url = (command, id, options) => {
|
|||||||
return `/rest/${command}?${params.toString()}`
|
return `/rest/${command}?${params.toString()}`
|
||||||
}
|
}
|
||||||
|
|
||||||
const scrobble = (id, submission = false, time) =>
|
const scrobble = (id, time, submission = true) =>
|
||||||
httpClient(
|
httpClient(
|
||||||
url('scrobble', id, {
|
url('scrobble', id, {
|
||||||
...(submission && time && { time }),
|
...(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))
|
const star = (id) => httpClient(url('star', id))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user