From 54a57d845258c3d22b956df94d9523bf4d730499 Mon Sep 17 00:00:00 2001 From: Stelios Tsampas Date: Wed, 15 Apr 2026 22:34:31 +0300 Subject: [PATCH] [cli/core]: report grant date information with `info` Entitlements are updated only when there is an asset update. If no matching entitlement is found, the creation date from the game's metadata is returned instead. --- legendary/cli.py | 8 ++++++-- legendary/core.py | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/legendary/cli.py b/legendary/cli.py index 0a5df55..10cc967 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -1652,7 +1652,7 @@ class LegendaryCLI: args.offline = True manifest_data = None - entitlements = None + entitlements = [] is_preloaded = False manifest_secrets = dict() # load installed manifest or URI @@ -1669,7 +1669,7 @@ class LegendaryCLI: else: logger.info('Game not installed and offline mode enabled, cannot load manifest.') elif game: - entitlements = self.core.egs.get_user_entitlements_full() + entitlements = self.core.lgd.entitlements if self.core.lgd.entitlements else [] egl_meta = self.core.egs.get_game_info(game.namespace, game.catalog_item_id) game.metadata = egl_meta # Get manifest if asset exists for current platform @@ -1683,6 +1683,10 @@ class LegendaryCLI: game.app_version(args.platform))) all_versions = {k: v.build_version for k, v in game.asset_infos.items()} game_infos.append(InfoItem('All versions', 'platform_versions', all_versions, all_versions)) + # Grant date from entitlements + entitlement = next((ent for ent in entitlements if ent['namespace'] == game.namespace), None) + grant_date = entitlement["grantDate"] if entitlement else game.metadata["creationDate"] + game_infos.append(InfoItem('Grant date', 'grant_date', grant_date, grant_date)) # Cloud save support for Mac and Windows game_infos.append(InfoItem('Cloud saves supported', 'cloud_saves_supported', game.supports_cloud_saves or game.supports_mac_cloud_saves, diff --git a/legendary/core.py b/legendary/core.py index d2d8214..31872bf 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -499,6 +499,10 @@ class LegendaryCore: elif not any(i['path'] == 'mods' for i in game.metadata.get('categories', [])) and platform in app_assets: _ret.append(game) + if meta_updated: + self.log.info('Updating entitlements.') + self.lgd.entitlements = self.egs.get_user_entitlements_full() + self.update_aliases(force=meta_updated) if meta_updated: self._prune_metadata()