mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 01:45:28 +00:00
[core] Minor improvements for DLC/logging
This commit is contained in:
parent
50bd35683f
commit
f4b1605b92
|
@ -101,7 +101,7 @@ class LegendaryCore:
|
||||||
|
|
||||||
# if session still has at least 10 minutes left we can re-use it.
|
# if session still has at least 10 minutes left we can re-use it.
|
||||||
if dt_exp > dt_now and abs(td.total_seconds()) > 600:
|
if dt_exp > dt_now and abs(td.total_seconds()) > 600:
|
||||||
self.log.debug('Trying to re-use existing login session...')
|
self.log.info('Trying to re-use existing login session...')
|
||||||
try:
|
try:
|
||||||
self.egs.resume_session(self.lgd.userdata)
|
self.egs.resume_session(self.lgd.userdata)
|
||||||
return True
|
return True
|
||||||
|
@ -113,6 +113,7 @@ class LegendaryCore:
|
||||||
self.log.info('Falling back to using refresh token...')
|
self.log.info('Falling back to using refresh token...')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
self.log.info('Logging in...')
|
||||||
userdata = self.egs.start_session(self.lgd.userdata['refresh_token'])
|
userdata = self.egs.start_session(self.lgd.userdata['refresh_token'])
|
||||||
except InvalidCredentialsError:
|
except InvalidCredentialsError:
|
||||||
self.log.error('Stored credentials are no longer valid! Please login again.')
|
self.log.error('Stored credentials are no longer valid! Please login again.')
|
||||||
|
@ -172,6 +173,9 @@ class LegendaryCore:
|
||||||
|
|
||||||
def get_dlc_for_game(self, app_name):
|
def get_dlc_for_game(self, app_name):
|
||||||
game = self.get_game(app_name)
|
game = self.get_game(app_name)
|
||||||
|
if game.is_dlc: # dlc shouldn't have DLC
|
||||||
|
return []
|
||||||
|
|
||||||
_, dlcs = self.get_game_and_dlc_list(update_assets=False)
|
_, dlcs = self.get_game_and_dlc_list(update_assets=False)
|
||||||
return dlcs[game.asset_info.catalog_item_id]
|
return dlcs[game.asset_info.catalog_item_id]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue