@@ -20,13 +20,20 @@ import { loadUsers } from './user'
20
20
import { GameInfo , InstallPlatform } from 'common/types'
21
21
import { getGamesdbData } from '../gog/library'
22
22
import { apiInfoCache } from '../gog/electronStores'
23
+ import { GlobalConfig } from 'backend/config'
23
24
24
25
const library = new Map < string , GameInfo > ( )
25
26
const installed = new Map < string , SteamInstallInfo > ( )
26
27
27
28
export async function getOwnedGames (
28
29
userId : string
29
30
) : Promise < OwnedGame [ ] | undefined > {
31
+ if ( ! GlobalConfig . get ( ) . getSettings ( ) . enableSteamIntegration ) {
32
+ logDebug ( 'Steam integration is disabled in settings' , {
33
+ prefix : LogPrefix . Steam
34
+ } )
35
+ return [ ]
36
+ }
30
37
if ( isMac ) {
31
38
logWarning ( 'getOwnedGames is not supported on macOS' , {
32
39
prefix : LogPrefix . Steam
@@ -54,6 +61,12 @@ const ignoredAppIds = [
54
61
]
55
62
56
63
export async function getInstalledGames ( ) {
64
+ if ( ! GlobalConfig . get ( ) . getSettings ( ) . enableSteamIntegration ) {
65
+ logDebug ( 'Steam integration is disabled in settings' , {
66
+ prefix : LogPrefix . Steam
67
+ } )
68
+ return
69
+ }
57
70
const steamLibraries = await getSteamLibraries ( )
58
71
const steamAppsDirs = steamLibraries . map ( ( lib ) => path . join ( lib , 'steamapps' ) )
59
72
@@ -94,6 +107,12 @@ export async function getInstalledGames() {
94
107
}
95
108
96
109
export async function refresh ( ) : Promise < null > {
110
+ if ( ! GlobalConfig . get ( ) . getSettings ( ) . enableSteamIntegration ) {
111
+ logDebug ( 'Steam integration is disabled in settings' , {
112
+ prefix : LogPrefix . Steam
113
+ } )
114
+ return null
115
+ }
97
116
const steamUsers = await loadUsers ( )
98
117
99
118
const enabledSteamUsers = steamUsers . reduce ( ( acc , val ) => {
0 commit comments