From 449b531155c7dcc90982a7225767869fd5738def Mon Sep 17 00:00:00 2001 From: loathingKernel <142770+loathingKernel@users.noreply.github.com> Date: Fri, 6 Sep 2024 23:47:43 +0300 Subject: [PATCH] EntitlementsWorker: fetch full entitlements on legendary>=0.20.35 --- rare/components/tabs/games/integrations/ubisoft_group.py | 6 +++++- rare/shared/workers/fetch.py | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/rare/components/tabs/games/integrations/ubisoft_group.py b/rare/components/tabs/games/integrations/ubisoft_group.py index 24a44a6484..59cfc4972a 100644 --- a/rare/components/tabs/games/integrations/ubisoft_group.py +++ b/rare/components/tabs/games/integrations/ubisoft_group.py @@ -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} diff --git a/rare/shared/workers/fetch.py b/rare/shared/workers/fetch.py index b9be3d2138..b5c4db99d5 100644 --- a/rare/shared/workers/fetch.py +++ b/rare/shared/workers/fetch.py @@ -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)