Lgndr: Update to legendary 0.20.29
This commit is contained in:
parent
e7da1d52eb
commit
1137d75e79
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue