Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cylorun committed Jun 11, 2024
1 parent 927b7e5 commit 84c2b6c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/me/cylorun/pace/rpc/DiscordStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public void init() {
public void updatePresence() throws IOException {
DiscordRichPresence p = this.getNewPresence();
if (p == null) {
DiscordRPC.discordClearPresence();
return;
}
DiscordRPC.discordUpdatePresence(p);
Expand Down Expand Up @@ -74,7 +75,7 @@ private DiscordRichPresence getNewPresence() throws IOException {
JsonObject latestEvent = eventList.get(eventList.size() - 1).getAsJsonObject();
String currentSplit = latestEvent.get("eventId").getAsString();
String currentTime = PaceMan.formatTime(Integer.parseInt(latestEvent.get("igt").getAsString()));
Pair<String, String> text = getText(currentSplit);
Pair<String, String> text = this.getText(currentSplit);

return new DiscordRichPresence.Builder("Current Time: " + currentTime)
.setStartTimestamps(this.start)
Expand All @@ -85,6 +86,9 @@ private DiscordRichPresence getNewPresence() throws IOException {
}

Pair<Integer, String> stats = this.getStats();
if (stats == null) {
return null;
}
String enters = stats.getLeft() == null || !options.show_enter_avg ? "" : String.format("Enters: %s", stats.getLeft());
String avg = stats.getRight() == null || !options.show_enter_avg ? "" : String.format("Enter Avg: %s", stats.getRight());

Expand Down

0 comments on commit 84c2b6c

Please sign in to comment.