mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 17:55:27 +00:00
[cli/core] Replace old manual game store query with new property
This commit is contained in:
parent
9462aa331f
commit
8c002a76e0
|
@ -234,13 +234,14 @@ class LegendaryCLI:
|
||||||
for game in games:
|
for game in games:
|
||||||
print(f' * {game.app_title.strip()} (App name: {game.app_name} | Version: {game.app_version})')
|
print(f' * {game.app_title.strip()} (App name: {game.app_name} | Version: {game.app_version})')
|
||||||
if not game.app_version:
|
if not game.app_version:
|
||||||
_custom_attribs = game.metadata.get('customAttributes', {})
|
_store = game.third_party_store
|
||||||
_store = _custom_attribs.get('ThirdPartyManagedApp', {}).get('value', 'Unknown')
|
|
||||||
if _store == 'Origin':
|
if _store == 'Origin':
|
||||||
print(f' - This game has to be activated, installed, and launched via Origin, use '
|
print(f' - This game has to be activated, installed, and launched via Origin, use '
|
||||||
f'"legendary launch --origin {game.app_name}" to activate and/or run the game.')
|
f'"legendary launch --origin {game.app_name}" to activate and/or run the game.')
|
||||||
else:
|
elif _store:
|
||||||
print(f' ! This game has to be installed through third-party store ({_store}, not supported)')
|
print(f' ! This game has to be installed through third-party store ({_store}, not supported)')
|
||||||
|
else:
|
||||||
|
print(f' ! No version information (unknown cause)')
|
||||||
for dlc in dlc_list[game.asset_info.catalog_item_id]:
|
for dlc in dlc_list[game.asset_info.catalog_item_id]:
|
||||||
print(f' + {dlc.app_title} (App name: {dlc.app_name} | Version: {dlc.app_version})')
|
print(f' + {dlc.app_title} (App name: {dlc.app_name} | Version: {dlc.app_version})')
|
||||||
if not dlc.app_version:
|
if not dlc.app_version:
|
||||||
|
@ -623,9 +624,7 @@ class LegendaryCLI:
|
||||||
f'to fetch data for Origin titles before using this command.')
|
f'to fetch data for Origin titles before using this command.')
|
||||||
return
|
return
|
||||||
|
|
||||||
_custom_attribs = game.metadata.get('customAttributes', {})
|
if not game.third_party_store or game.third_party_store != 'Origin':
|
||||||
_store = _custom_attribs.get('ThirdPartyManagedApp', {}).get('value', None)
|
|
||||||
if not _store or _store != 'Origin':
|
|
||||||
logger.error(f'The specified game is not an Origin title.')
|
logger.error(f'The specified game is not an Origin title.')
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -340,8 +340,7 @@ class LegendaryCore:
|
||||||
|
|
||||||
def asset_available(self, game: Game) -> bool:
|
def asset_available(self, game: Game) -> bool:
|
||||||
# Just say yes for Origin titles
|
# Just say yes for Origin titles
|
||||||
_store = game.metadata.get('customAttributes', {}).get('ThirdPartyManagedApp', {}).get('value', None)
|
if game.third_party_store:
|
||||||
if _store:
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue