Skip to content

Commit 3ce9513

Browse files
committed
chore: logs and install from card
1 parent fa2c242 commit 3ce9513

File tree

3 files changed

+11
-23
lines changed

3 files changed

+11
-23
lines changed

src/backend/storeManagers/steam/library.ts

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,9 @@ export async function getInstalledGames() {
5050
const steamLibraries = await getSteamLibraries()
5151
const steamAppsDirs = steamLibraries.map((lib) => path.join(lib, 'steamapps'))
5252

53-
console.log(
54-
'Steam apps directories: ------------------------------->',
55-
steamAppsDirs
56-
)
53+
logDebug(['Steam libraries found:', steamAppsDirs.join(', ')], {
54+
prefix: LogPrefix.Steam
55+
})
5756

5857
installed.clear()
5958
for (const steamApps of steamAppsDirs) {
@@ -97,23 +96,13 @@ export async function refresh(): Promise<null> {
9796
return acc
9897
}, [] as Array<SteamLoginUser>)
9998

100-
console.log(
101-
'Steam users: ------------------------------->',
102-
steamUsers,
103-
enabledSteamUsers
104-
)
105-
10699
libraryCache.get('games', []).forEach((game) => {
107100
library.set(game.app_name, game)
108101
})
109102

110103
await getInstalledGames()
111104
// Get all user owned games
112105

113-
console.log(
114-
'Installed games: ------------------------------->',
115-
installed.size
116-
)
117106
if (!isOnline()) {
118107
logDebug('App offline, skipping steam sync', { prefix: LogPrefix.Steam })
119108
return null
@@ -127,10 +116,6 @@ export async function refresh(): Promise<null> {
127116
if (!ownedGames?.length) {
128117
continue
129118
}
130-
console.log(
131-
'Owned games: ------------------------------->',
132-
ownedGames.length
133-
)
134119
apiInfoCache.use_in_memory()
135120
for (const steamGame of ownedGames) {
136121
if (ignoredAppIds.includes(steamGame.appid.toString())) {
@@ -158,11 +143,6 @@ export async function refresh(): Promise<null> {
158143
}
159144
}
160145

161-
console.log(
162-
'New game object: ------------------------------->',
163-
newGameObject
164-
)
165-
166146
const installedGame = installed.get(steamGame.appid.toString())
167147
if (installedGame) {
168148
newGameObject.is_installed = true

src/frontend/screens/Game/GamePage/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,11 @@ export default observer(function GamePage(): React.JSX.Element | null {
961961

962962
// open install dialog
963963
if (!is_installed) {
964+
if (isSteam) {
965+
return window.api.openExternalUrl(
966+
`steam://install/${gameInfo.app_name}`
967+
)
968+
}
964969
return handleModal()
965970
}
966971

src/frontend/screens/Library/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ export default observer(function Library(): React.JSX.Element {
111111
runner: Runner,
112112
gameInfo: GameInfo | null
113113
) {
114+
if (runner === 'steam') {
115+
return window.api.openExternalUrl(`steam://install/${appName}`)
116+
}
114117
setShowModal({ game: appName, show: true, runner, gameInfo })
115118
}
116119

0 commit comments

Comments
 (0)