Skip to content

Commit

Permalink
only seek when player is playing
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Oct 13, 2023
1 parent 76ef7c7 commit f0c93ed
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,10 @@ class PlayerRestHandler(
// we handle position differently for playing new tracks
playerUpdate.position.takeIfPresent { encodedTrack is Omissible.Omitted && playerUpdate.identifier is Omissible.Omitted }
?.let {
player.seekTo(it)
SocketServer.sendPlayerUpdate(context, player)
if (player.isPlaying) {
player.seekTo(it)
SocketServer.sendPlayerUpdate(context, player)
}
}

playerUpdate.endTime.takeIfPresent { encodedTrack is Omissible.Omitted && playerUpdate.identifier is Omissible.Omitted }
Expand Down

0 comments on commit f0c93ed

Please sign in to comment.