mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-16 17:51:23 +10:00
feat(library): implement playtime tracking on the frontend
This commit is contained in:
@ -94,3 +94,37 @@ export type Settings = {
|
||||
maxDownloadThreads: number;
|
||||
forceOffline: boolean;
|
||||
};
|
||||
|
||||
export type GamePlaytimeStats = {
|
||||
gameId: string;
|
||||
totalPlaytimeSeconds: number;
|
||||
sessionCount: number;
|
||||
firstPlayed: string;
|
||||
lastPlayed: string;
|
||||
averageSessionLength: number;
|
||||
currentSessionDuration?: number;
|
||||
};
|
||||
|
||||
export type PlaytimeSession = {
|
||||
gameId: string;
|
||||
startTime: string;
|
||||
sessionId: string;
|
||||
};
|
||||
|
||||
export type PlaytimeUpdateEvent = {
|
||||
gameId: string;
|
||||
stats: GamePlaytimeStats;
|
||||
isActive: boolean;
|
||||
};
|
||||
|
||||
export type PlaytimeSessionStartEvent = {
|
||||
gameId: string;
|
||||
startTime: string;
|
||||
};
|
||||
|
||||
export type PlaytimeSessionEndEvent = {
|
||||
gameId: string;
|
||||
sessionDurationSeconds: number;
|
||||
totalPlaytimeSeconds: number;
|
||||
sessionCount: number;
|
||||
};
|
||||
Reference in New Issue
Block a user