mirror of
https://github.com/derrod/legendary.git
synced 2026-05-07 06:23:22 +00:00
[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.
This commit is contained in:
parent
aeb61d4eea
commit
54a57d8452
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue