Skip to content

Commit

Permalink
fix not being able to seek when player is paused
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Jan 3, 2024
1 parent a72496a commit bd0b61b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class WebSocketHandler(

private fun seek(json: JSONObject) {
val player = context.getPlayer(json.getLong("guildId"))
if (!player.isPlaying) {
if (player.track == null) {
log.warn("Can't seek when player is not playing anything")
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class PlayerRestHandler(
// we handle position differently for playing new tracks
playerUpdate.position.takeIf { it.isPresent && !playerUpdate.encodedTrack.isPresent && !playerUpdate.identifier.isPresent }
?.let {
if (player.isPlaying) {
if (player.track != null) {
player.seekTo(it.value)
SocketServer.sendPlayerUpdate(context, player)
}
Expand Down

0 comments on commit bd0b61b

Please sign in to comment.