Lgndr: Expose 'resolve_aliases' for outside usage
This commit is contained in:
parent
3aae3887f6
commit
545d77ef07
|
@ -28,8 +28,7 @@ def find_app_name(path: str, core) -> Optional[str]:
|
||||||
with open(os.path.join(path, ".egstore", i)) as file:
|
with open(os.path.join(path, ".egstore", i)) as file:
|
||||||
app_name = json.load(file).get("AppName")
|
app_name = json.load(file).get("AppName")
|
||||||
return app_name
|
return app_name
|
||||||
elif app_name := legendary_utils.resolve_aliases(
|
elif app_name := LegendaryCLISingleton().resolve_aliases(os.path.basename(os.path.normpath(path))):
|
||||||
core, os.path.basename(os.path.normpath(path))):
|
|
||||||
# return None if game does not exist (Workaround for overlay)
|
# return None if game does not exist (Workaround for overlay)
|
||||||
if not core.get_game(app_name):
|
if not core.get_game(app_name):
|
||||||
return None
|
return None
|
||||||
|
|
|
@ -39,6 +39,9 @@ class LegendaryCLI(legendary.cli.LegendaryCLI):
|
||||||
self.handler = LgndrLogHandler()
|
self.handler = LgndrLogHandler()
|
||||||
self.logger.addHandler(self.handler)
|
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):
|
def prepare_install(self, args: LgndrInstallGameArgs) -> (DLManager, AnalysisResult, InstalledGame, Game, bool, Optional[str], ConditionCheckResult):
|
||||||
old_choice = legendary.cli.get_boolean_choice
|
old_choice = legendary.cli.get_boolean_choice
|
||||||
legendary.cli.get_boolean_choice = get_boolean_choice
|
legendary.cli.get_boolean_choice = get_boolean_choice
|
||||||
|
|
Loading…
Reference in a new issue