Skip to content

Commit ad3b89a

Browse files
committed
renamed it to local games
1 parent 3e7c773 commit ad3b89a

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ create a file named `config.json` in the same directory as main.py and fill it i
8686
"USE_STEAM_STORE_FALLBACK": true
8787
},
8888

89-
"CUSTOM_GAMES": {
89+
"LOCAL_GAMES": {
9090
"ENABLED": false,
9191
"GAMES": [
9292
"processName1",

exampleconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"USE_STEAM_STORE_FALLBACK": true
1313
},
1414

15-
"CUSTOM_GAMES": {
15+
"LOCAL_GAMES": {
1616
"ENABLED": false,
1717
"GAMES": [
1818
"processName1",

main.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -286,17 +286,17 @@ def getLocalPresence():
286286

287287
# load the custom games, all lower case
288288
config = getConfigFile()
289-
templist = config["CUSTOM_GAMES"]["GAMES"]
290-
customGames = []
289+
templist = config["LOCAL_GAMES"]["GAMES"]
290+
localGames = []
291291
for i in templist:
292-
customGames.append(i.lower())
292+
localGames.append(i.lower())
293293

294294

295295
gameFound = False
296296
# loop thru all open applications
297297
for process in psutil.process_iter():
298298
# if the name is in the list, set it to the gamename and stop the loop
299-
if process.name().lower() in customGames:
299+
if process.name().lower() in localGames:
300300
if not isPlaying:
301301
log(f"found {process.name()} running locally")
302302
gameFound = True
@@ -330,12 +330,17 @@ def getLocalPresence():
330330
gamesFile.write(f"{process.name().lower()}={process.name().title()}\n")
331331
gamesFile.close()
332332

333+
gameName = process.name().title()
334+
startTime = process.create_time()
333335

334336
else:
335337
log("games.txt does not exist, creating one")
336338
with open(f'{dirname(__file__)}/games.txt', 'a') as gamesFile:
337339
gamesFile.write(f"{process.name()}={process.name().title()}\n")
338340
gamesFile.close()
341+
342+
gameName = process.name().title()
343+
startTime = process.create_time()
339344

340345

341346

@@ -359,7 +364,7 @@ def setPresenceDetails():
359364
def main():
360365
global steamAPIKey
361366
global defaultAppID
362-
global customGames
367+
global localGames
363368

364369
global appID
365370
global startTime
@@ -382,8 +387,8 @@ def main():
382387

383388
steamAPIKey = config["STEAM_API_KEY"]
384389
defaultAppID = config["DISCORD_APPLICATION_ID"]
385-
doLocalGames = config["CUSTOM_GAMES"]["ENABLED"]
386-
customGames = config["CUSTOM_GAMES"]["GAMES"]
390+
doLocalGames = config["LOCAL_GAMES"]["ENABLED"]
391+
localGames = config["LOCAL_GAMES"]["GAMES"]
387392

388393
steamStoreCoverartBackup = config["COVER_ART"]["USE_STEAM_STORE_FALLBACK"]
389394
gridEnabled = config["COVER_ART"]["STEAM_GRID_DB"]["ENABLED"]

0 commit comments

Comments
 (0)