mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-22 00:03:51 +02:00
fix: add activity store and user activity caching
This commit is contained in:
@@ -1386,6 +1386,23 @@ const gameLog = {
|
||||
return data;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get current user's online sessions after a given timestamp (incremental).
|
||||
* @param {string} afterCreatedAt - Only return rows created after this timestamp
|
||||
* @returns {Promise<Array<{created_at: string, time: number}>>}
|
||||
*/
|
||||
async getCurrentUserOnlineSessionsAfter(afterCreatedAt) {
|
||||
const data = [];
|
||||
await sqliteService.execute(
|
||||
(dbRow) => {
|
||||
data.push({ created_at: dbRow[0], time: dbRow[1] || 0 });
|
||||
},
|
||||
`SELECT created_at, time FROM gamelog_location WHERE created_at > @after ORDER BY created_at`,
|
||||
{ '@after': afterCreatedAt }
|
||||
);
|
||||
return data;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get current user's top visited worlds from gamelog_location.
|
||||
* Groups by world_id and aggregates visit count and total time.
|
||||
|
||||
Reference in New Issue
Block a user