Compare commits

...

4 Commits

Author SHA1 Message Date
Zamitto
c75a6ad439 fix: using achievement count data from api 2025-11-11 18:15:26 -03:00
Chubby Granny Chaser
436d1b74be ci: fixing format
Some checks failed
Build Renderer / build (push) Has been cancelled
Release / build (ubuntu-latest) (push) Has been cancelled
Release / build (windows-2022) (push) Has been cancelled
2025-11-11 18:35:18 +00:00
Chubby Granny Chaser
b89de065fe ci: fixing format 2025-11-11 18:33:28 +00:00
Chubby Granny Chaser
7fcdab07cb Merge pull request #1842 from hydralauncher/feat/displaying-new-game-update
Feat: displaying new game update
2025-11-11 18:23:42 +00:00
8 changed files with 18 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "hydralauncher",
"version": "3.7.4",
"version": "3.7.5",
"description": "Hydra",
"main": "./out/main/index.js",
"author": "Los Broxas",

View File

@@ -4,7 +4,6 @@ import {
downloadsSublevel,
gamesShopAssetsSublevel,
gamesSublevel,
gameAchievementsSublevel,
} from "@main/level";
const getLibrary = async (): Promise<LibraryGame[]> => {
@@ -19,33 +18,19 @@ const getLibrary = async (): Promise<LibraryGame[]> => {
const download = await downloadsSublevel.get(key);
const gameAssets = await gamesShopAssetsSublevel.get(key);
let unlockedAchievementCount = 0;
let achievementCount = 0;
try {
const achievements = await gameAchievementsSublevel.get(key);
if (achievements) {
achievementCount = achievements.achievements.length;
unlockedAchievementCount =
achievements.unlockedAchievements.length;
}
} catch {
// No achievements data for this game
}
return {
id: key,
...game,
download: download ?? null,
unlockedAchievementCount,
achievementCount,
unlockedAchievementCount: game.unlockedAchievementCount ?? 0,
achievementCount: game.achievementCount ?? 0,
// Spread gameAssets last to ensure all image URLs are properly set
...gameAssets,
// Preserve custom image URLs from game if they exist
customIconUrl: game.customIconUrl,
customLogoImageUrl: game.customLogoImageUrl,
customHeroImageUrl: game.customHeroImageUrl,
} as LibraryGame;
};
})
);
});

View File

@@ -9,6 +9,8 @@ type ProfileGame = {
hasManuallyUpdatedPlaytime: boolean;
isFavorite?: boolean;
isPinned?: boolean;
achievementCount: number;
unlockedAchievementCount: number;
} & ShopAssets;
export const mergeWithRemoteGames = async () => {
@@ -39,6 +41,8 @@ export const mergeWithRemoteGames = async () => {
playTimeInMilliseconds: updatedPlayTime,
favorite: game.isFavorite ?? localGame.favorite,
isPinned: game.isPinned ?? localGame.isPinned,
achievementCount: game.achievementCount,
unlockedAchievementCount: game.unlockedAchievementCount,
});
} else {
await gamesSublevel.put(gameKey, {
@@ -55,6 +59,8 @@ export const mergeWithRemoteGames = async () => {
isDeleted: false,
favorite: game.isFavorite ?? false,
isPinned: game.isPinned ?? false,
achievementCount: game.achievementCount,
unlockedAchievementCount: game.unlockedAchievementCount,
});
}

View File

@@ -47,7 +47,7 @@ export function GameCard({ game, ...props }: GameCardProps) {
>
<div className="game-card__backdrop">
<img
src={game.libraryImageUrl}
src={game.libraryImageUrl ?? undefined}
alt={game.title}
className="game-card__cover"
loading="lazy"

View File

@@ -50,14 +50,14 @@ export function Hero() {
>
<div className="hero__backdrop">
<img
src={game.libraryHeroImageUrl}
src={game.libraryHeroImageUrl ?? undefined}
alt={game.description ?? ""}
className="hero__media"
/>
<div className="hero__content">
<img
src={game.logoImageUrl}
src={game.logoImageUrl ?? undefined}
width="250px"
alt={game.description ?? ""}
loading="eager"

View File

@@ -128,7 +128,6 @@
border: 1px solid rgba(34, 197, 94, 0.5);
}
&__section-header {
display: flex;
justify-content: space-between;

View File

@@ -42,9 +42,9 @@ export interface ShopAssets {
shop: GameShop;
title: string;
iconUrl: string | null;
libraryHeroImageUrl: string;
libraryImageUrl: string;
logoImageUrl: string;
libraryHeroImageUrl: string | null;
libraryImageUrl: string | null;
logoImageUrl: string | null;
logoPosition: string | null;
coverImageUrl: string | null;
downloadSources: string[];

View File

@@ -56,6 +56,8 @@ export interface Game {
launchOptions?: string | null;
favorite?: boolean;
isPinned?: boolean;
achievementCount?: number;
unlockedAchievementCount?: number;
pinnedDate?: Date | null;
automaticCloudSync?: boolean;
hasManuallyUpdatedPlaytime?: boolean;