From 988be667df308d2af0cc4339c4d4ccf456db2db7 Mon Sep 17 00:00:00 2001 From: derrod Date: Sat, 18 Apr 2020 06:10:13 +0200 Subject: [PATCH] [core] Simplify game installation directory code --- legendary/core.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/legendary/core.py b/legendary/core.py index aa7ee2a..76abfcc 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -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)