Skip to content

Commit

Permalink
Merge pull request #452 from loathingKernel/develop
Browse files Browse the repository at this point in the history
EntitlementsWorker: fetch full entitlements on legendary>=0.20.35
  • Loading branch information
loathingKernel authored Sep 6, 2024
2 parents 9e2380e + 449b531 commit 7b1cbe7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion rare/components/tabs/games/integrations/ubisoft_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ def run_real(self) -> None:

if (entitlements := self.core.lgd.entitlements) is None:
with timelogger(logger, "Request entitlements"):
entitlements = self.core.egs.get_user_entitlements()
try:
entitlements = self.core.egs.get_user_entitlements_full()
except AttributeError as e:
logger.warning(e)
entitlements = self.core.egs.get_user_entitlements()
self.core.lgd.entitlements = entitlements
entitlements = {i["entitlementName"] for i in entitlements}

Expand Down
6 changes: 5 additions & 1 deletion rare/shared/workers/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ def run_real(self):
# Get entitlements, Ubisoft integration also uses them
self.signals.progress.emit(0, self.signals.tr("Updating entitlements"))
with timelogger(logger, "Request entitlements"):
entitlements = self.core.egs.get_user_entitlements()
try:
entitlements = self.core.egs.get_user_entitlements_full()
except AttributeError as e:
logger.warning(e)
entitlements = self.core.egs.get_user_entitlements()
self.core.lgd.entitlements = entitlements
logger.info(f"Entitlements: %s", len(list(entitlements)))
self.signals.result.emit(entitlements, FetchWorker.Result.ENTITLEMENTS)
Expand Down

0 comments on commit 7b1cbe7

Please sign in to comment.