Skip to content

Commit

Permalink
Update NSLGameScanner.py
Browse files Browse the repository at this point in the history
  • Loading branch information
moraroy committed Jun 22, 2024
1 parent e518f29 commit a9082f3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions NSLGameScanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,13 @@ def get_unsigned_shortcut_id(signed_shortcut_id):
shortcuts_file = f"{logged_in_home}/.steam/root/userdata/{steamid3}/config/shortcuts.vdf"

# Check if the file exists and is not executable
if os.path.exists(shortcuts_file) and not os.access(shortcuts_file, os.X_OK):
print("The file exists and is not executable.")
# Write {'shortcuts: {}} to the file
if os.path.exists(shortcuts_file):
# Check if the file is not executable
if not os.access(shortcuts_file, os.X_OK):
print("The file exists but is not executable. Making it executable.")
# Make the file executable for the user
os.chmod(shortcuts_file, os.stat(shortcuts_file).st_mode | 0o100)
# Write {'shortcuts': {}} to the file
with open(shortcuts_file, 'wb') as file:
file.write(vdf.binary_dumps({'shortcuts': {}}))
shortcuts = {'shortcuts': {}}
Expand All @@ -212,6 +216,7 @@ def get_unsigned_shortcut_id(signed_shortcut_id):
print(f"Error reading file: {e}")
shortcuts = {}


# Check if the 'shortcuts' key is in the loaded data
if 'shortcuts' not in shortcuts:
print("The file does not contain the 'shortcuts' key.")
Expand Down

0 comments on commit a9082f3

Please sign in to comment.