mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-09 16:19:25 -07:00
fix(ci): simplify first-session day count cast
This commit is contained in:
@@ -93,12 +93,11 @@ function isFirstSessionForLocalDay(
|
|||||||
currentSessionId: number,
|
currentSessionId: number,
|
||||||
startedAtMs: number,
|
startedAtMs: number,
|
||||||
): boolean {
|
): boolean {
|
||||||
return (
|
return Number(
|
||||||
Number(
|
(
|
||||||
(
|
db
|
||||||
db
|
.prepare(
|
||||||
.prepare(
|
`
|
||||||
`
|
|
||||||
SELECT COUNT(*) AS count
|
SELECT COUNT(*) AS count
|
||||||
FROM imm_sessions
|
FROM imm_sessions
|
||||||
WHERE date(started_at_ms / 1000, 'unixepoch', 'localtime') = date(? / 1000, 'unixepoch', 'localtime')
|
WHERE date(started_at_ms / 1000, 'unixepoch', 'localtime') = date(? / 1000, 'unixepoch', 'localtime')
|
||||||
@@ -107,11 +106,10 @@ function isFirstSessionForLocalDay(
|
|||||||
OR (started_at_ms = ? AND session_id < ?)
|
OR (started_at_ms = ? AND session_id < ?)
|
||||||
)
|
)
|
||||||
`,
|
`,
|
||||||
)
|
)
|
||||||
.get(startedAtMs, startedAtMs, startedAtMs, currentSessionId) as ExistenceRow | null
|
.get(startedAtMs, startedAtMs, startedAtMs, currentSessionId) as ExistenceRow | null,
|
||||||
)?.count ?? 0,
|
)?.count ?? 0
|
||||||
) === 0;
|
) === 0;
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetLifetimeSummaries(db: DatabaseSync, nowMs: string): void {
|
function resetLifetimeSummaries(db: DatabaseSync, nowMs: string): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user