Skip to content

Commit

Permalink
Merge pull request #578 from MQDuck/bingo-file-time
Browse files Browse the repository at this point in the history
Choose bingo directory based on modified time
  • Loading branch information
Die4Ever authored Jan 13, 2024
2 parents 8fa61dc + b396ec4 commit 4fbff9f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions BingoDisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,17 @@ def getDefaultPath():
Path.home() /'.local'/'share'/'Steam'/'steamapps'/'compatdata'/'6910'/'pfx'/'drive_c'/'users'/'steamuser'/'Documents'/'Deus Ex'/'System',
Path.home() /'.local'/'share'/'Steam'/'steamapps'/'common'/'Deus Ex'/'System',
]
p:Path

modified_times = {}
for p in checks:
f:Path = p / "DXRBingo.ini"
if f.exists():
return p
modified_times[p] = os.path.getmtime(f)
sorted_paths = sorted(modified_times.keys(), key=lambda f: modified_times[f])

if len(sorted_paths) > 0:
return sorted_paths[-1]
p:Path
for p in checks:
if p.is_dir():
return p
Expand Down

0 comments on commit 4fbff9f

Please sign in to comment.