mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-27 02:21:30 +01:00
Fixed afk time formatting in server accordion on player page
This commit is contained in:
parent
7a80d52142
commit
44d1647420
@ -53,7 +53,7 @@ public class ServerAccordion extends AbstractAccordion {
|
|||||||
|
|
||||||
List<Session> sessions = profile.getSessions(serverUUID);
|
List<Session> sessions = profile.getSessions(serverUUID);
|
||||||
long playtime = PlayerProfile.getPlaytime(sessions.stream());
|
long playtime = PlayerProfile.getPlaytime(sessions.stream());
|
||||||
long afk = PlayerProfile.getAFKTime(sessions.stream());
|
long afkTime = PlayerProfile.getAFKTime(sessions.stream());
|
||||||
int sessionCount = sessions.size();
|
int sessionCount = sessions.size();
|
||||||
long avgSession = MathUtils.averageLong(playtime, sessionCount);
|
long avgSession = MathUtils.averageLong(playtime, sessionCount);
|
||||||
long sessionMedian = PlayerProfile.getSessionMedian(sessions.stream());
|
long sessionMedian = PlayerProfile.getSessionMedian(sessions.stream());
|
||||||
@ -64,6 +64,7 @@ public class ServerAccordion extends AbstractAccordion {
|
|||||||
long deaths = PlayerProfile.getDeathCount(sessions.stream());
|
long deaths = PlayerProfile.getDeathCount(sessions.stream());
|
||||||
|
|
||||||
String play = FormatUtils.formatTimeAmount(playtime);
|
String play = FormatUtils.formatTimeAmount(playtime);
|
||||||
|
String afk = FormatUtils.formatTimeAmount(afkTime);
|
||||||
String avg = sessionCount != 0 ? FormatUtils.formatTimeAmount(avgSession) : "-";
|
String avg = sessionCount != 0 ? FormatUtils.formatTimeAmount(avgSession) : "-";
|
||||||
String median = sessionCount != 0 ? FormatUtils.formatTimeAmount(sessionMedian) : "-";
|
String median = sessionCount != 0 ? FormatUtils.formatTimeAmount(sessionMedian) : "-";
|
||||||
String longest = sessionCount != 0 ? FormatUtils.formatTimeAmount(longestSession) : "-";
|
String longest = sessionCount != 0 ? FormatUtils.formatTimeAmount(longestSession) : "-";
|
||||||
|
Loading…
Reference in New Issue
Block a user