From 4d9019b15bd682bc6f9b83c7473c06006a72fd2b Mon Sep 17 00:00:00 2001 From: Charlie Morley Date: Wed, 31 May 2023 18:32:02 -0600 Subject: [PATCH] !seek says correct direction to timestamp --- .../java/com/jagrosh/jmusicbot/commands/music/SeekCmd.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/jagrosh/jmusicbot/commands/music/SeekCmd.java b/src/main/java/com/jagrosh/jmusicbot/commands/music/SeekCmd.java index e859d0b1a..8a5256857 100644 --- a/src/main/java/com/jagrosh/jmusicbot/commands/music/SeekCmd.java +++ b/src/main/java/com/jagrosh/jmusicbot/commands/music/SeekCmd.java @@ -272,7 +272,8 @@ public static void doSeek(Bot bot, CommandEvent event, long direction, long time return; } - long targetTimeMs = track.getPosition(); + long originalPosition = track.getPosition(); + long targetTimeMs = originalPosition; if (direction == 0) { targetTimeMs = timeMs; } else if (direction > 0) { @@ -301,7 +302,7 @@ public static void doSeek(Bot bot, CommandEvent event, long direction, long time track.setPosition(targetTimeMs); if (direction == 0) { - event.reply(bot.getSuccess(event)+" "+(targetTimeMs > track.getPosition() ? "Fast forwarded" : "Rewound")+" to `"+timeMsToFriendlyOutputTimestampString(targetTimeMs)+"`."); + event.reply(bot.getSuccess(event)+" "+(targetTimeMs > originalPosition ? "Fast forwarded" : "Rewound")+" to `"+timeMsToFriendlyOutputTimestampString(targetTimeMs)+"`."); } else { event.reply(bot.getSuccess(event)+" "+(direction > 0 ? "Fast forwarded" : "Rewound")+" "+timeMsToFriendlyOutputDurationString(timeMs)+" to `"+timeMsToFriendlyOutputTimestampString(targetTimeMs)+"`."); }