mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 17:55:27 +00:00
[cli] Improve Ubisoft activation messaging
This commit is contained in:
parent
c8189460c2
commit
e1b5245252
|
@ -1746,8 +1746,10 @@ class LegendaryCLI:
|
||||||
ubi_account_id = ext_auth['externalAuthId']
|
ubi_account_id = ext_auth['externalAuthId']
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
logger.error('No ubisoft account found! Please link your accounts via the following link: '
|
logger.error('No linked ubisoft account found! Please link your accounts via your browser and try again.')
|
||||||
'https://www.epicgames.com/id/link/ubisoft')
|
webbrowser.open('https://www.epicgames.com/id/link/ubisoft')
|
||||||
|
print('If web page did not open automatically, please manually open the following URL: '
|
||||||
|
'https://www.epicgames.com/id/link/ubisoft')
|
||||||
return
|
return
|
||||||
|
|
||||||
uplay_keys = self.core.egs.store_get_uplay_codes()
|
uplay_keys = self.core.egs.store_get_uplay_codes()
|
||||||
|
@ -1756,15 +1758,17 @@ class LegendaryCLI:
|
||||||
|
|
||||||
games = self.core.get_game_list()
|
games = self.core.get_game_list()
|
||||||
uplay_games = []
|
uplay_games = []
|
||||||
|
activated = 0
|
||||||
for game in games:
|
for game in games:
|
||||||
if game.metadata.get('customAttributes', {}).get('partnerLinkType', {}).get('value') != 'ubisoft':
|
if game.metadata.get('customAttributes', {}).get('partnerLinkType', {}).get('value') != 'ubisoft':
|
||||||
continue
|
continue
|
||||||
if game.metadata.get('customAttributes', {}).get('partnerLinkId', {}).get('value') in redeemed:
|
if game.metadata.get('customAttributes', {}).get('partnerLinkId', {}).get('value') in redeemed:
|
||||||
|
activated += 1
|
||||||
continue
|
continue
|
||||||
uplay_games.append(game)
|
uplay_games.append(game)
|
||||||
|
|
||||||
if not uplay_games:
|
if not uplay_games:
|
||||||
logger.info('No remaining games found.')
|
logger.info(f'All of your {activated} Uplay titles have already been activated on your Ubisoft account.')
|
||||||
return
|
return
|
||||||
|
|
||||||
logger.info(f'Found {len(uplay_games)} game(s) to redeem:')
|
logger.info(f'Found {len(uplay_games)} game(s) to redeem:')
|
||||||
|
|
Loading…
Reference in a new issue