mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-10 04:19:25 -07:00
fix(ci): normalize daily session count extraction
This commit is contained in:
@@ -93,11 +93,9 @@ function isFirstSessionForLocalDay(
|
||||
currentSessionId: number,
|
||||
startedAtMs: number,
|
||||
): boolean {
|
||||
return Number(
|
||||
const sameDayCount = Number(
|
||||
(
|
||||
db
|
||||
.prepare(
|
||||
`
|
||||
db.prepare(`
|
||||
SELECT COUNT(*) AS count
|
||||
FROM imm_sessions
|
||||
WHERE date(started_at_ms / 1000, 'unixepoch', 'localtime') = date(? / 1000, 'unixepoch', 'localtime')
|
||||
@@ -106,10 +104,11 @@ function isFirstSessionForLocalDay(
|
||||
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
|
||||
) === 0;
|
||||
);
|
||||
return sameDayCount === 0;
|
||||
}
|
||||
|
||||
function resetLifetimeSummaries(db: DatabaseSync, nowMs: string): void {
|
||||
|
||||
Reference in New Issue
Block a user