This repository was archived by the owner on Dec 10, 2025. It is now read-only.
feat: add sorting option for playtime retrieval methods #85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature to the
Playtimeinterface and its implementation, allowing playtime data to be optionally sorted by duration. Additionally, it includes a minor localization change in thePlaytimeCommand. Below is a summary of the most important changes:Feature: Sorting Playtime Data by Duration
surf-cloud-api-common/src/main/kotlin/dev/slne/surf/cloud/api/common/player/playtime/Playtime.kt: Updated methods in thePlaytimeinterface (playtimesPerServer,playtimesPerCategory,playtimePerCategoryPerServer,topServers, andtopCategories) to include an optionalsortByPlaytimeparameter for sorting results by playtime duration. [1] [2] [3]surf-cloud-core-common/src/main/kotlin/dev/slne/surf/cloud/core/common/player/playtime/PlaytimeImpl.kt: Implemented thesortByPlaytimeparameter in the corresponding methods, enabling sorting of playtime data at different levels (server, category, and category-per-server). The sorting logic was added for both individual and grouped results. [1] [2] [3]Localization Improvement
surf-cloud-bukkit/src/main/kotlin/dev/slne/surf/cloud/bukkit/command/playtime/PlaytimeCommand.kt: Changed the label for "Total" playtime to "Gesamt" in thesendPlaytimemethod for better localization.fixes #83