diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 3b3ad552..2c81eac2 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -368,7 +368,10 @@ "background_image_updated": "Background image updated", "stats": "Stats", "achievements": "Achievements", - "games": "Games" + "games": "Games", + "top_percentile": "Top {{percentile}}%", + "ranking_updated_weekly": "Ranking is updated weekly", + "playing": "Playing {{game}}" }, "achievement": { "achievement_unlocked": "Achievement unlocked", diff --git a/src/locales/pt-BR/translation.json b/src/locales/pt-BR/translation.json index c8e72eb1..0ed8a3b4 100644 --- a/src/locales/pt-BR/translation.json +++ b/src/locales/pt-BR/translation.json @@ -300,7 +300,7 @@ "last_time_played": "Última sessão {{period}}", "activity": "Atividades recentes", "library": "Biblioteca", - "total_play_time": "Tempo total de jogo: {{amount}}", + "total_play_time": "Tempo de jogo: {{amount}}", "no_recent_activity_title": "Hmmm… nada por aqui", "no_recent_activity_description": "Parece que você não jogou nada recentemente. Que tal começar agora?", "display_name": "Nome de exibição", @@ -366,7 +366,8 @@ "background_image_updated": "Imagem de fundo salva", "stats": "Estatísticas", "achievements": "Conquistas", - "games": "Jogos" + "games": "Jogos", + "ranking_updated_weekly": "Ranking é atualizado semanalmente" }, "achievement": { "achievement_unlocked": "Conquista desbloqueada", diff --git a/src/main/events/user/get-user.ts b/src/main/events/user/get-user.ts index 6bbab9c4..f51b0456 100644 --- a/src/main/events/user/get-user.ts +++ b/src/main/events/user/get-user.ts @@ -11,7 +11,7 @@ const getSteamGame = async (objectId: string) => { }); return { - title: steamGame.name, + title: steamGame.name as string, iconUrl: steamUrlBuilder.icon(objectId, steamGame.clientIcon), }; } catch (err) { @@ -67,8 +67,25 @@ const getUser = async ( } } + const friends = await Promise.all( + profile.friends.map(async (friend) => { + if (!friend.currentGame) return friend; + + const currentGame = await getSteamGame(friend.currentGame.objectId); + + return { + ...friend, + currentGame: { + ...friend.currentGame, + ...currentGame, + }, + }; + }) + ); + return { ...profile, + friends, libraryGames, recentGames, }; diff --git a/src/main/services/hydra-api.ts b/src/main/services/hydra-api.ts index 49e2db36..63dd9b16 100644 --- a/src/main/services/hydra-api.ts +++ b/src/main/services/hydra-api.ts @@ -30,7 +30,7 @@ export class HydraApi { private static instance: AxiosInstance; private static readonly EXPIRATION_OFFSET_IN_MS = 1000 * 60 * 5; // 5 minutes - private static readonly ADD_LOG_INTERCEPTOR = false; + private static readonly ADD_LOG_INTERCEPTOR = true; private static secondsToMilliseconds = (seconds: number) => seconds * 1000; diff --git a/src/renderer/src/pages/profile/profile-content/friends-box.tsx b/src/renderer/src/pages/profile/profile-content/friends-box.tsx index 82d4ff9d..4d3df7e8 100644 --- a/src/renderer/src/pages/profile/profile-content/friends-box.tsx +++ b/src/renderer/src/pages/profile/profile-content/friends-box.tsx @@ -5,6 +5,7 @@ import { useTranslation } from "react-i18next"; import * as styles from "./profile-content.css"; import { Avatar, Link } from "@renderer/components"; +import { buildGameDetailsPath } from "@renderer/helpers"; export function FriendsBox() { const { userProfile, userStats } = useContext(userProfileContext); @@ -35,7 +36,16 @@ export function FriendsBox() { alt={friend.displayName} /> - {friend.displayName} +
{t("playing", { game: friend.currentGame.title })}
+ + )} +{t("achievements")}
+
- Top {userStats.achievementsPointsEarnedSum.topPercentile}%{" "} +
+ {t("top_percentile", { + percentile: + userStats.achievementsPointsEarnedSum.topPercentile, + })}
Unlock count: {userStats.unlockedAchievementSum}
@@ -59,13 +62,20 @@ export function UserStatsBox() { )}{t("games")}
+- Total playtime:{" "} - {formatPlayTime(userStats.totalPlayTimeInSeconds.value)} + {t("total_play_time", { + amount: formatPlayTime( + userStats.totalPlayTimeInSeconds.value + ), + })} +
++ {t("top_percentile", { + percentile: userStats.totalPlayTimeInSeconds.topPercentile, + })}
-Top {userStats.totalPlayTimeInSeconds.topPercentile}%