[cli] Do not override platform in "info" command

Also improve missing asset error.
This commit is contained in:
derrod 2021-12-28 10:09:08 +01:00
parent 363ac15faa
commit 335619ff79

View file

@ -1385,13 +1385,16 @@ class LegendaryCLI:
InfoItem = namedtuple('InfoItem', ['name', 'json_name', 'value', 'json_value']) InfoItem = namedtuple('InfoItem', ['name', 'json_name', 'value', 'json_value'])
if self.core.is_installed(app_name): if self.core.is_installed(app_name):
args.platform = self.core.get_installed_game(app_name).platform installed_platform = self.core.get_installed_game(app_name).platform
if installed_platform != args.platform:
logger.warning(f'Game is installed for platform "{installed_platform}", '
f'but requested metadata is for "{args.platform}", this may '
f'lead to unexpected results.')
game = self.core.get_game(app_name, update_meta=not args.offline, platform=args.platform) game = self.core.get_game(app_name, update_meta=not args.offline, platform=args.platform)
if game and not self.core.asset_available(game, platform=args.platform): if game and not self.core.asset_available(game, platform=args.platform):
logger.warning(f'Asset information for "{game.app_name}" is missing, the game may have been removed from ' logger.warning(f'Asset information for "{game.app_name}" is missing, this may be due to the game '
f'your account or you may be logged in with a different account than the one used to build ' f'not being available on the selected platform or currently logged-in account.')
f'legendary\'s metadata database.')
args.offline = True args.offline = True
manifest_data = None manifest_data = None