mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-10 18:37:57 +01:00
Fix compile issues
This commit is contained in:
parent
950cee9e9f
commit
0071190820
@ -154,13 +154,13 @@ public class ServerPlaceHolders implements Placeholders {
|
||||
private void registerDynamicCategoryPlaceholders(PlanPlaceholders placeholders, Database database) {
|
||||
List<TopCategoryQuery> queries = new ArrayList<>();
|
||||
queries.addAll(createCategoryQueriesForAllTimespans("playtime", (index, timespan) -> TopListQueries.fetchNthTop10PlaytimePlayerOn(serverInfo.getServerUUID(), index, System.currentTimeMillis() - timespan, System.currentTimeMillis())));
|
||||
queries.addAll(createCategoryQueriesForAllTimespans("active_playtime", (index, timespan) -> TopListQueries.fetchNthTop10ActivePlaytimePlayerOn(serverInfo.getServerUUID(), index, System.currentTimeMillis() - timespan, System.currentTimeMillis())));))
|
||||
queries.addAll(createCategoryQueriesForAllTimespans("active_playtime", (index, timespan) -> TopListQueries.fetchNthTop10ActivePlaytimePlayerOn(serverInfo.getServerUUID(), index, System.currentTimeMillis() - timespan, System.currentTimeMillis())));
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
for (TopCategoryQuery query : queries) {
|
||||
final int nth = i;
|
||||
placeholders.registerStatic(String.format("top_%s_%s_%s", query.getCategory(), query.getTimeSpan(), nth),
|
||||
() -> database.query(query.getQuery(nth)));
|
||||
() -> database.query(query.getQuery(nth)).orElse("-"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -195,7 +195,7 @@ public class ServerPlaceHolders implements Placeholders {
|
||||
return timeSpan;
|
||||
}
|
||||
|
||||
public Query<String> getQuery(int i) {
|
||||
public Query<Optional<String>> getQuery(int i) {
|
||||
return queryCreator.apply(i, timeSpanMillis);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user