From 1e4176805a189002aa8dc3040e652d79a7405402 Mon Sep 17 00:00:00 2001 From: Tormak <63308171+Tormak9970@users.noreply.github.com> Date: Tue, 11 Jul 2023 16:32:17 -0500 Subject: [PATCH] fix: reduce count needed for games to display --- package.json | 2 +- src/lib/controllers/AppController.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index acf84896..131981c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "steam-art-manager", - "version": "2.6.4", + "version": "2.6.3", "private": true, "type": "module", "author": { diff --git a/src/lib/controllers/AppController.ts b/src/lib/controllers/AppController.ts index 44df801f..4467d671 100644 --- a/src/lib/controllers/AppController.ts +++ b/src/lib/controllers/AppController.ts @@ -287,8 +287,8 @@ export class AppController { const entries = Object.entries(res); unfilteredLibraryCache.set(JSON.parse(JSON.stringify(unfiltered))); - // const filtered = entries.filter(([appId, entry]) => Object.keys(entry).length >= 4 || shortcutIds.includes(appId)); //! Removed this because it caused issues with games with no grids - const filtered = entries; + const filtered = entries.filter(([appId, entry]) => Object.keys(entry).length >= 2 || shortcutIds.includes(appId)); //! Look into this because it seems like it aint ideal this because it caused issues with games with no grids + // const filtered = entries; return Object.fromEntries(filtered); } @@ -450,7 +450,7 @@ export class AppController { const filteredKeys = Object.keys(filteredCache); if (online && !needsSteamAPIKey) { - const apiGames = await this.getGamesFromSteamAPI(bUserId); + const apiGames = (await this.getGamesFromSteamAPI(bUserId)).filter((entry) => filteredKeys.includes(entry.appid.toString())); console.log("Steam API Games:", apiGames); steamGames.set(apiGames); @@ -458,7 +458,7 @@ export class AppController { LogController.log("Steam games loaded."); } else if (online) { try { - const publicGames = (await this.getGamesFromSteamCommunity(bUserId)).filter((entry: GameStruct) => !entry.name.toLowerCase().includes("soundtrack")); + const publicGames = (await this.getGamesFromSteamCommunity(bUserId)).filter((entry: GameStruct) => filteredKeys.includes(entry.appid.toString()) && !entry.name.toLowerCase().includes("soundtrack")); console.log("Public Games:", publicGames); steamGames.set(publicGames);