From 8922541191fcba36c7ce8e0e3d3fffa2d257bc47 Mon Sep 17 00:00:00 2001
From: Rsl1122
Date: Fri, 6 Apr 2018 10:23:06 +0300
Subject: [PATCH] Added active playtime to quick overview on player page
---
.../plan/system/webserver/pages/parsing/InspectPage.java | 4 ++++
Plan/src/main/resources/web/player.html | 2 ++
2 files changed, 6 insertions(+)
diff --git a/Plan/src/main/java/com/djrapitops/plan/system/webserver/pages/parsing/InspectPage.java b/Plan/src/main/java/com/djrapitops/plan/system/webserver/pages/parsing/InspectPage.java
index 680c820d2..6bbd8a09b 100644
--- a/Plan/src/main/java/com/djrapitops/plan/system/webserver/pages/parsing/InspectPage.java
+++ b/Plan/src/main/java/com/djrapitops/plan/system/webserver/pages/parsing/InspectPage.java
@@ -154,6 +154,8 @@ public class InspectPage extends Page {
long afkWeek = PlayerProfile.getAFKTime(sessionsWeek.stream());
long afkMonth = PlayerProfile.getAFKTime(sessionsMonth.stream());
+ long activeTotal = playtime - afk;
+
long longestSession = PlayerProfile.getLongestSession(allSessions.stream());
long longestSessionDay = PlayerProfile.getLongestSession(sessionsDay.stream());
long longestSessionWeek = PlayerProfile.getLongestSession(sessionsWeek.stream());
@@ -179,6 +181,8 @@ public class InspectPage extends Page {
addValue("playtimeWeek", playtimeWeek > 0L ? FormatUtils.formatTimeAmount(playtimeWeek) : "-");
addValue("playtimeMonth", playtimeMonth > 0L ? FormatUtils.formatTimeAmount(playtimeMonth) : "-");
+ addValue("activeTotal", activeTotal > 0L ? FormatUtils.formatTimeAmount(activeTotal) : "-");
+
addValue("afkTotal", afk > 0L ? FormatUtils.formatTimeAmount(afk) : "-");
addValue("afkDay", afkDay > 0L ? FormatUtils.formatTimeAmount(afkDay) : "-");
addValue("afkWeek", afkWeek > 0L ? FormatUtils.formatTimeAmount(afkWeek) : "-");
diff --git a/Plan/src/main/resources/web/player.html b/Plan/src/main/resources/web/player.html
index 3cca9f67d..b1aa7b0b3 100644
--- a/Plan/src/main/resources/web/player.html
+++ b/Plan/src/main/resources/web/player.html
@@ -292,6 +292,8 @@
class="pull-right">${sessionCount}
Total Playtime ${playtimeTotal}
+ Total Active ${activeTotal}
Total AFK ${afkTotal}
Longest Session