Skip to content

Commit

Permalink
Merge pull request #627 from hydralauncher/feat/get-total-playtime-fr…
Browse files Browse the repository at this point in the history
…om-api

feat: get total playtime from api
  • Loading branch information
zamitto authored Jun 22, 2024
2 parents 92a3061 + 9da6792 commit fbcacd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/renderer/src/pages/user/user-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ export function UserContent({
const { formatDistance, formatDiffInMillis } = useDate();

const formatPlayTime = () => {
const seconds = userProfile.libraryGames.reduce(
(acc, game) => acc + game.playTimeInSeconds,
0
);
const seconds = userProfile.totalPlayTimeInSeconds;
const minutes = seconds / 60;

if (minutes < MAX_MINUTES_TO_SHOW_IN_PLAYTIME) {
Expand Down
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ export interface UserProfile {
id: string;
displayName: string;
profileImageUrl: string | null;
totalPlayTimeInSeconds: number;
libraryGames: UserGame[];
recentGames: UserGame[];
}
Expand Down

0 comments on commit fbcacd7

Please sign in to comment.