From 1137d75e79ad78795d1819e08d2b404e2acb7feb Mon Sep 17 00:00:00 2001 From: loathingKernel <142770+loathingKernel@users.noreply.github.com> Date: Fri, 16 Sep 2022 15:22:21 +0300 Subject: [PATCH] Lgndr: Update to legendary 0.20.29 --- pyproject.toml | 2 +- rare/lgndr/cli.py | 2 +- rare/lgndr/core.py | 24 ------------------------ 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 193d0c60..82307ac5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ pywebview = [ { version = "^3.6.3", extras = ["cef"], platform = "windows", optional = true }, { version = "^3.6.3", extras = ["gtk"], platform = "linux", optional = true }, ] -legendary-gl = "^0.20.28" +legendary-gl = "^0.20.29" typing-extensions = "^4.3.0" [tool.poetry.scripts] diff --git a/rare/lgndr/cli.py b/rare/lgndr/cli.py index eb1e7ba1..9d30eb5d 100644 --- a/rare/lgndr/cli.py +++ b/rare/lgndr/cli.py @@ -442,7 +442,7 @@ class LegendaryCLI(LegendaryCLIReal): percentage = (processed / total_size) * 100.0 num += 1 - if (delta := ((current_time := time.time()) - last_update)) > 1 or (not last_processed and delta > 1): + if (delta := ((current_time := time.time()) - last_update)) > 1: last_update = current_time speed = (processed - last_processed) / 1024 / 1024 / delta last_processed = processed diff --git a/rare/lgndr/core.py b/rare/lgndr/core.py index c0f11efd..b12d66ae 100644 --- a/rare/lgndr/core.py +++ b/rare/lgndr/core.py @@ -28,30 +28,6 @@ class LegendaryCore(LegendaryCoreReal): # def get_installed_game(self, app_name, skip_sync=True) -> InstalledGame: # return super(LegendaryCore, self).get_installed_game(app_name, skip_sync) - # FIXME: delete this when legendary merges https://github.com/derrod/legendary/pull/477 - def get_cdn_manifest(self, game, platform='Windows', disable_https=False): - manifest_urls, base_urls, manifest_hash = self.get_cdn_urls(game, platform) - - if disable_https: - manifest_urls = [url.replace('https://', 'http://') for url in manifest_urls] - - manifest_bytes = None - for url in manifest_urls: - self.log.debug(f'Trying to download manifest from {url} ...') - r = self.egs.unauth_session.get(url) - if r.ok: - manifest_bytes = r.content - break - else: - self.log.warning(f'Unable to download manifest from {url}, trying next one ...') - if not manifest_bytes: - raise ValueError('Unable to get manifest data from any CDN URL') - - if sha1(manifest_bytes).hexdigest() != manifest_hash: - raise ValueError('Manifest sha hash mismatch!') - - return manifest_bytes, base_urls - def prepare_download(self, game: Game, base_game: Game = None, base_path: str = '', status_q: Queue = None, max_shm: int = 0, max_workers: int = 0, force: bool = False, disable_patching: bool = False,