Skip to content

Commit

Permalink
!seek says correct direction to timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
cmorley191 committed Jun 1, 2023
1 parent 7462e3d commit 4d9019b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)+"`.");
}
Expand Down

0 comments on commit 4d9019b

Please sign in to comment.