Skip to content

Commit

Permalink
fix: show correct words based on platform
Browse files Browse the repository at this point in the history
  • Loading branch information
darbyjack committed Sep 11, 2023
1 parent 60d11d3 commit 092f4b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ public List<BasicComponent> build() {
text(parameters().getResourceCount(), "%d resources", author.resources());

if (author.likes() != -1) {
final String word = backend == ServiceBackend.MODRINTH ? "followers" : "likes";
String word;
switch(backend) {
case MODRINTH -> word = "followers";
case HANGAR -> word = "stars";
default -> word = "likes";
}
text(parameters().getLikes(), "%s %s", NumberUtil.abbreviate(author.likes()), word);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public List<BasicComponent> build() {

switch(backend) {
case CURSEFORGE, MODRINTH -> date(parameters().getUpdated(), OffsetDateTime.parse(resource.lastUpdated()).toInstant(), "Updated:");
case HANGAR -> text(parameters().getReviews(), "%s likes", NumberUtil.abbreviate(resource.rating().count()));
case HANGAR -> text(parameters().getReviews(), "%s stars", NumberUtil.abbreviate(resource.rating().count()));
default -> text(parameters().getReviews(), "%s reviews", NumberUtil.abbreviate(resource.rating().count()));
}

Expand Down

0 comments on commit 092f4b2

Please sign in to comment.