[cli/core] Ensure update checks use the right platform(s)

This commit is contained in:
derrod 2021-12-01 21:02:38 +01:00
parent f280d53496
commit e8207d53cd
2 changed files with 7 additions and 2 deletions

View file

@ -255,7 +255,9 @@ class LegendaryCLI:
if not self.core.login(): if not self.core.login():
logger.error('Login failed! Not checking for updates.') logger.error('Login failed! Not checking for updates.')
else: else:
self.core.get_assets(True) # Update assets for all platforms currently installed
for platform in self.core.get_installed_platforms():
self.core.get_assets(True, platform=platform)
games = sorted(self.core.get_installed_list(include_dlc=True), games = sorted(self.core.get_installed_list(include_dlc=True),
key=lambda x: x.title.lower()) key=lambda x: x.title.lower())
@ -559,7 +561,7 @@ class LegendaryCLI:
if not args.skip_version_check and not self.core.is_noupdate_game(app_name): if not args.skip_version_check and not self.core.is_noupdate_game(app_name):
logger.info('Checking for updates...') logger.info('Checking for updates...')
try: try:
latest = self.core.get_asset(app_name, update=True) latest = self.core.get_asset(app_name, update=True, platform=igame.platform)
except ValueError: except ValueError:
logger.fatal(f'Metadata for "{app_name}" does not exist, cannot launch!') logger.fatal(f'Metadata for "{app_name}" does not exist, cannot launch!')
exit(1) exit(1)

View file

@ -467,6 +467,9 @@ class LegendaryCore:
_, dlcs = self.get_game_and_dlc_list(update_assets=False, platform=platform) _, dlcs = self.get_game_and_dlc_list(update_assets=False, platform=platform)
return dlcs[game.asset_infos['Windows'].catalog_item_id] return dlcs[game.asset_infos['Windows'].catalog_item_id]
def get_installed_platforms(self):
return {i.platform for i in self._get_installed_list(False)}
def get_installed_list(self, include_dlc=False) -> List[InstalledGame]: def get_installed_list(self, include_dlc=False) -> List[InstalledGame]:
if self.egl_sync_enabled: if self.egl_sync_enabled:
self.log.debug('Running EGL sync...') self.log.debug('Running EGL sync...')