[core] Simplify game installation directory code

This commit is contained in:
derrod 2020-04-18 06:10:13 +02:00
parent c2ae5b7367
commit 988be667df

View file

@ -353,15 +353,13 @@ class LegendaryCore:
base_path = self.get_default_install_dir() base_path = self.get_default_install_dir()
if game.is_dlc: if game.is_dlc:
install_path = os.path.join( game_folder = base_game.metadata.get('customAttributes', {}).\
base_path, get('FolderName', {}).get('value', base_game.app_name)
base_game.metadata.get('customAttributes', {}).get('FolderName', {}).get('value', game.app_name)
)
else: else:
install_path = os.path.join( game_folder = game.metadata.get('customAttributes', {}).\
base_path, get('FolderName', {}).get('value', game.app_name)
game.metadata.get('customAttributes', {}).get('FolderName', {}).get('value', game.app_name)
) install_path = os.path.join(base_path, game_folder)
if not os.path.exists(install_path): if not os.path.exists(install_path):
os.makedirs(install_path) os.makedirs(install_path)