From 545d77ef072c2868a44869e74576b2278e49b56d Mon Sep 17 00:00:00 2001 From: loathingKernel <142770+loathingKernel@users.noreply.github.com> Date: Sun, 10 Jul 2022 21:23:54 +0300 Subject: [PATCH] Lgndr: Expose 'resolve_aliases' for outside usage --- rare/components/tabs/games/import_sync/import_group.py | 3 +-- rare/lgndr/cli.py | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rare/components/tabs/games/import_sync/import_group.py b/rare/components/tabs/games/import_sync/import_group.py index 678204ba..90e54314 100644 --- a/rare/components/tabs/games/import_sync/import_group.py +++ b/rare/components/tabs/games/import_sync/import_group.py @@ -28,8 +28,7 @@ def find_app_name(path: str, core) -> Optional[str]: with open(os.path.join(path, ".egstore", i)) as file: app_name = json.load(file).get("AppName") return app_name - elif app_name := legendary_utils.resolve_aliases( - core, os.path.basename(os.path.normpath(path))): + elif app_name := LegendaryCLISingleton().resolve_aliases(os.path.basename(os.path.normpath(path))): # return None if game does not exist (Workaround for overlay) if not core.get_game(app_name): return None diff --git a/rare/lgndr/cli.py b/rare/lgndr/cli.py index bf5f4d01..9b4d1959 100644 --- a/rare/lgndr/cli.py +++ b/rare/lgndr/cli.py @@ -39,6 +39,9 @@ class LegendaryCLI(legendary.cli.LegendaryCLI): self.handler = LgndrLogHandler() self.logger.addHandler(self.handler) + def resolve_aliases(self, name): + super(LegendaryCLI, self)._resolve_aliases(name) + def prepare_install(self, args: LgndrInstallGameArgs) -> (DLManager, AnalysisResult, InstalledGame, Game, bool, Optional[str], ConditionCheckResult): old_choice = legendary.cli.get_boolean_choice legendary.cli.get_boolean_choice = get_boolean_choice