mirror of
https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck.git
synced 2024-11-20 08:09:18 +01:00
Update NSLGameScanner.py
This commit is contained in:
parent
548c4e41ff
commit
582ce6e1d0
@ -554,21 +554,25 @@ for launcher_name, folder in folder_names.items():
|
|||||||
# Get the app ID for this launcher from the app_id_to_name dictionary
|
# Get the app ID for this launcher from the app_id_to_name dictionary
|
||||||
appid = app_ids.get(launcher_name)
|
appid = app_ids.get(launcher_name)
|
||||||
|
|
||||||
# Define the new path of the folder
|
# If appid is not None, proceed with renaming and symlink creation
|
||||||
new_path = os.path.join(compatdata_dir, str(appid))
|
if appid is not None:
|
||||||
|
# Define the new path of the folder
|
||||||
|
new_path = os.path.join(compatdata_dir, str(appid))
|
||||||
|
|
||||||
# Check if the new path already exists
|
# Check if the new path already exists
|
||||||
if os.path.exists(new_path):
|
if os.path.exists(new_path):
|
||||||
print(f'{new_path} already exists. Skipping renaming.')
|
print(f'{new_path} already exists. Skipping renaming.')
|
||||||
|
else:
|
||||||
|
# Rename the folder
|
||||||
|
os.rename(current_path, new_path)
|
||||||
|
|
||||||
|
# Define the path of the symbolic link
|
||||||
|
symlink_path = os.path.join(compatdata_dir, folder)
|
||||||
|
|
||||||
|
# Create a symbolic link to the renamed folder
|
||||||
|
os.symlink(new_path, symlink_path)
|
||||||
else:
|
else:
|
||||||
# Rename the folder
|
print(f'App ID for {launcher_name} is not available yet.')
|
||||||
os.rename(current_path, new_path)
|
|
||||||
|
|
||||||
# Define the path of the symbolic link
|
|
||||||
symlink_path = os.path.join(compatdata_dir, folder)
|
|
||||||
|
|
||||||
# Create a symbolic link to the renamed folder
|
|
||||||
os.symlink(new_path, symlink_path)
|
|
||||||
else:
|
else:
|
||||||
print(f'{launcher_name}: {folder} does not exist')
|
print(f'{launcher_name}: {folder} does not exist')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user