Skip to content

Commit

Permalink
Don't send invalid scrobbles when clearing the player's queue
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Jul 26, 2021
1 parent fb4eefc commit e68b22e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/src/audioplayer/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const Player = () => {
}

if (!scrobbled) {
subsonic.scrobble(info.trackId, true, startTime)
info.trackId && subsonic.scrobble(info.trackId, startTime)
setScrobbled(true)
}
},
Expand Down
4 changes: 2 additions & 2 deletions ui/src/subsonic/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ 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 }),
submission,
})
)

const nowPlaying = (id) => scrobble(id, false)
const nowPlaying = (id) => scrobble(id, null, false)

const star = (id) => httpClient(url('star', id))

Expand Down

0 comments on commit e68b22e

Please sign in to comment.