mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-04 07:28:26 +01:00
Fixed checkstyle & activity index precision on SQLite
This commit is contained in:
parent
b375661047
commit
08ea042144
@ -197,7 +197,7 @@ public class SessionsMutator {
|
|||||||
return session -> {
|
return session -> {
|
||||||
Long start = session.getUnsafe(SessionKeys.START);
|
Long start = session.getUnsafe(SessionKeys.START);
|
||||||
long end = session.getValue(SessionKeys.END).orElse(System.currentTimeMillis());
|
long end = session.getValue(SessionKeys.END).orElse(System.currentTimeMillis());
|
||||||
return (after <= end && start <= before);
|
return after <= end && start <= before;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ public class ActivityIndexQueries {
|
|||||||
String selectThreeWeeks = selectActivePlaytimeSQL + UNION_ALL + selectActivePlaytimeSQL + UNION_ALL + selectActivePlaytimeSQL;
|
String selectThreeWeeks = selectActivePlaytimeSQL + UNION_ALL + selectActivePlaytimeSQL + UNION_ALL + selectActivePlaytimeSQL;
|
||||||
|
|
||||||
return SELECT +
|
return SELECT +
|
||||||
"5.0 - 5.0 * AVG(1.0 / (?/2.0 * (q1.active_playtime/?) +1.0)) as activity_index," +
|
"5.0 - 5.0 * AVG(1.0 / (?/2.0 * (q1.active_playtime*1.0/?) +1.0)) as activity_index," +
|
||||||
"q1." + SessionsTable.USER_UUID +
|
"q1." + SessionsTable.USER_UUID +
|
||||||
FROM + '(' + selectThreeWeeks + ") q1" +
|
FROM + '(' + selectThreeWeeks + ") q1" +
|
||||||
GROUP_BY + "q1." + SessionsTable.USER_UUID;
|
GROUP_BY + "q1." + SessionsTable.USER_UUID;
|
||||||
|
@ -90,7 +90,7 @@ public class NetworkActivityIndexQueries {
|
|||||||
String selectThreeWeeks = selectActivePlaytimeSQL + UNION_ALL + selectActivePlaytimeSQL + UNION_ALL + selectActivePlaytimeSQL;
|
String selectThreeWeeks = selectActivePlaytimeSQL + UNION_ALL + selectActivePlaytimeSQL + UNION_ALL + selectActivePlaytimeSQL;
|
||||||
|
|
||||||
return SELECT +
|
return SELECT +
|
||||||
"5.0 - 5.0 * AVG(1.0 / (?/2.0 * (q1.active_playtime/?) +1.0)) as activity_index," +
|
"5.0 - 5.0 * AVG(1.0 / (?/2.0 * (q1.active_playtime*1.0/?) +1.0)) as activity_index," +
|
||||||
"q1." + SessionsTable.USER_UUID +
|
"q1." + SessionsTable.USER_UUID +
|
||||||
FROM + '(' + selectThreeWeeks + ") q1" +
|
FROM + '(' + selectThreeWeeks + ") q1" +
|
||||||
GROUP_BY + "q1." + SessionsTable.USER_UUID;
|
GROUP_BY + "q1." + SessionsTable.USER_UUID;
|
||||||
|
Loading…
Reference in New Issue
Block a user