From f0c93edf34fbbf6298c78af410424471745f2f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?To=CF=80?= Date: Fri, 13 Oct 2023 12:24:36 +0200 Subject: [PATCH] only seek when player is playing --- .../main/java/lavalink/server/player/PlayerRestHandler.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/LavalinkServer/src/main/java/lavalink/server/player/PlayerRestHandler.kt b/LavalinkServer/src/main/java/lavalink/server/player/PlayerRestHandler.kt index 6c875621a..18355d8a8 100644 --- a/LavalinkServer/src/main/java/lavalink/server/player/PlayerRestHandler.kt +++ b/LavalinkServer/src/main/java/lavalink/server/player/PlayerRestHandler.kt @@ -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 }