One missing world color consistency addition

This commit is contained in:
Rsl1122 2017-10-27 19:26:11 +03:00
parent 417aac3f78
commit 96f034da9f

View File

@ -13,6 +13,8 @@ import main.java.com.djrapitops.plan.data.Action;
import main.java.com.djrapitops.plan.data.PlayerKill; import main.java.com.djrapitops.plan.data.PlayerKill;
import main.java.com.djrapitops.plan.data.Session; import main.java.com.djrapitops.plan.data.Session;
import main.java.com.djrapitops.plan.data.UserInfo; import main.java.com.djrapitops.plan.data.UserInfo;
import main.java.com.djrapitops.plan.data.time.GMTimes;
import main.java.com.djrapitops.plan.data.time.WorldTimes;
import main.java.com.djrapitops.plan.database.Database; import main.java.com.djrapitops.plan.database.Database;
import main.java.com.djrapitops.plan.database.tables.SessionsTable; import main.java.com.djrapitops.plan.database.tables.SessionsTable;
import main.java.com.djrapitops.plan.database.tables.UsersTable; import main.java.com.djrapitops.plan.database.tables.UsersTable;
@ -154,7 +156,18 @@ public class InspectPageParser extends PageParser {
addValue("playtimeTotal", FormatUtils.formatTimeAmount(playTime)); addValue("playtimeTotal", FormatUtils.formatTimeAmount(playTime));
String punchCardData = PunchCardGraphCreator.createDataSeries(allSessions); String punchCardData = PunchCardGraphCreator.createDataSeries(allSessions);
String[] worldPieData = WorldPieCreator.createSeriesData(db.getWorldTimesTable().getWorldTimesOfUser(uuid)); WorldTimes worldTimes = db.getWorldTimesTable().getWorldTimesOfUser(uuid);
// Add 0 time for worlds not present.
Set<String> nonZeroWorlds = worldTimes.getWorldTimes().keySet();
for (String world : db.getWorldTable().getWorlds()) {
if (nonZeroWorlds.contains(world)) {
continue;
}
worldTimes.setGMTimesForWorld(world, new GMTimes());
}
String[] worldPieData = WorldPieCreator.createSeriesData(worldTimes);
addValue("worldPieSeries", worldPieData[0]); addValue("worldPieSeries", worldPieData[0]);
addValue("gmSeries", worldPieData[1]); addValue("gmSeries", worldPieData[1]);