[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()
if game.is_dlc:
install_path = os.path.join(
base_path,
base_game.metadata.get('customAttributes', {}).get('FolderName', {}).get('value', game.app_name)
)
game_folder = base_game.metadata.get('customAttributes', {}).\
get('FolderName', {}).get('value', base_game.app_name)
else:
install_path = os.path.join(
base_path,
game.metadata.get('customAttributes', {}).get('FolderName', {}).get('value', game.app_name)
)
game_folder = 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):
os.makedirs(install_path)