From e8207d53cd2a5adbcffed8844f6d4e683e08b71c Mon Sep 17 00:00:00 2001 From: derrod Date: Wed, 1 Dec 2021 21:02:38 +0100 Subject: [PATCH] [cli/core] Ensure update checks use the right platform(s) --- legendary/cli.py | 6 ++++-- legendary/core.py | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/legendary/cli.py b/legendary/cli.py index 3af80de..d2a7ac9 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -255,7 +255,9 @@ class LegendaryCLI: if not self.core.login(): logger.error('Login failed! Not checking for updates.') 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), 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): logger.info('Checking for updates...') try: - latest = self.core.get_asset(app_name, update=True) + latest = self.core.get_asset(app_name, update=True, platform=igame.platform) except ValueError: logger.fatal(f'Metadata for "{app_name}" does not exist, cannot launch!') exit(1) diff --git a/legendary/core.py b/legendary/core.py index 67c1a63..543798c 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -467,6 +467,9 @@ class LegendaryCore: _, dlcs = self.get_game_and_dlc_list(update_assets=False, platform=platform) 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]: if self.egl_sync_enabled: self.log.debug('Running EGL sync...')