Fixed checkstyle & activity index precision on SQLite

This commit is contained in:
Risto Lahtela 2020-05-09 09:38:43 +03:00
parent b375661047
commit 08ea042144
3 changed files with 3 additions and 3 deletions

View File

@ -197,7 +197,7 @@ public class SessionsMutator {
return session -> {
Long start = session.getUnsafe(SessionKeys.START);
long end = session.getValue(SessionKeys.END).orElse(System.currentTimeMillis());
return (after <= end && start <= before);
return after <= end && start <= before;
};
}

View File

@ -88,7 +88,7 @@ public class ActivityIndexQueries {
String selectThreeWeeks = selectActivePlaytimeSQL + UNION_ALL + selectActivePlaytimeSQL + UNION_ALL + selectActivePlaytimeSQL;
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 +
FROM + '(' + selectThreeWeeks + ") q1" +
GROUP_BY + "q1." + SessionsTable.USER_UUID;

View File

@ -90,7 +90,7 @@ public class NetworkActivityIndexQueries {
String selectThreeWeeks = selectActivePlaytimeSQL + UNION_ALL + selectActivePlaytimeSQL + UNION_ALL + selectActivePlaytimeSQL;
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 +
FROM + '(' + selectThreeWeeks + ") q1" +
GROUP_BY + "q1." + SessionsTable.USER_UUID;