From c3ade2994e81594b962298ad1a570ef847743658 Mon Sep 17 00:00:00 2001 From: derrod Date: Fri, 17 Dec 2021 01:25:24 +0100 Subject: [PATCH] [cli/core/utils] Re-enable SDL for Mac platform Currently, this only affects Fortnite and UE. --- legendary/cli.py | 6 +----- legendary/core.py | 5 ++++- legendary/utils/selective_dl.py | 3 +++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/legendary/cli.py b/legendary/cli.py index a5855e4..5520aa6 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -787,13 +787,9 @@ class LegendaryCLI: elif config_disable_sdl or args.disable_sdl: sdl_enabled = False - # Disable SDL for non-Windows (for now, as no Mac SDL files are available right now) - if args.platform not in ('Win32', 'Windows'): - sdl_enabled = False - if sdl_enabled and ((sdl_name := get_sdl_appname(game.app_name)) is not None): if not self.core.is_installed(game.app_name) or config_tags is None or args.reset_sdl: - sdl_data = self.core.get_sdl_data(sdl_name) + sdl_data = self.core.get_sdl_data(sdl_name, platform=args.platform) if sdl_data: if args.skip_sdl: args.install_tag = [''] diff --git a/legendary/core.py b/legendary/core.py index 9727c41..9132a88 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -287,7 +287,10 @@ class LegendaryCore: def get_update_info(self): return self.lgd.get_cached_version()['data'].get('release_info') - def get_sdl_data(self, app_name): + def get_sdl_data(self, app_name, platform='Windows'): + if platform not in ('Win32', 'Windows'): + app_name = f'{app_name}_{platform}' + if app_name not in sdl_games: return None # load hardcoded data as fallback diff --git a/legendary/utils/selective_dl.py b/legendary/utils/selective_dl.py index c0ec31a..6fa37df 100644 --- a/legendary/utils/selective_dl.py +++ b/legendary/utils/selective_dl.py @@ -33,6 +33,9 @@ games = { def get_sdl_appname(app_name): for k in games.keys(): + if k.endswith('_Mac'): + continue + if app_name.startswith(k): return k return None