Skip to content

Commit

Permalink
only seek when player is playing
Browse files Browse the repository at this point in the history
# Conflicts:
#	LavalinkServer/src/main/java/lavalink/server/player/PlayerRestHandler.kt
  • Loading branch information
topi314 committed Oct 13, 2023
1 parent a884dbc commit cb866b3
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@ class PlayerRestHandler(
// we handle position differently for playing new tracks
playerUpdate.position.takeIf { it.isPresent && !playerUpdate.encodedTrack.isPresent && !playerUpdate.identifier.isPresent }
?.let {
player.seekTo(it.value)
SocketServer.sendPlayerUpdate(context, player)
if (player.isPlaying) {
player.seekTo(it)
SocketServer.sendPlayerUpdate(context, player)
}
}

playerUpdate.endTime.takeIf { it.isPresent && !playerUpdate.encodedTrack.isPresent && !playerUpdate.identifier.isPresent }
Expand Down

0 comments on commit cb866b3

Please sign in to comment.