1
0
Fork 0
mirror of synced 2024-06-17 10:04:43 +12:00

Lgndr: Expose 'resolve_aliases' for outside usage

This commit is contained in:
loathingKernel 2022-07-10 21:23:54 +03:00
parent 3aae3887f6
commit 545d77ef07
2 changed files with 4 additions and 2 deletions

View file

@ -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

View file

@ -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