mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 17:55:27 +00:00
[core] Add options for delta manifests and update-when-repairing
This commit is contained in:
parent
4b4483c580
commit
d1b8412b27
|
@ -657,7 +657,8 @@ class LegendaryCore:
|
||||||
platform_override: str = '', file_prefix_filter: list = None,
|
platform_override: str = '', file_prefix_filter: list = None,
|
||||||
file_exclude_filter: list = None, file_install_tag: list = None,
|
file_exclude_filter: list = None, file_install_tag: list = None,
|
||||||
dl_optimizations: bool = False, dl_timeout: int = 10,
|
dl_optimizations: bool = False, dl_timeout: int = 10,
|
||||||
repair: bool = False, egl_guid: str = ''
|
repair: bool = False, repair_use_latest: bool = False,
|
||||||
|
disable_delta: bool = False, egl_guid: str = ''
|
||||||
) -> (DLManager, AnalysisResult, ManifestMeta):
|
) -> (DLManager, AnalysisResult, ManifestMeta):
|
||||||
# load old manifest
|
# load old manifest
|
||||||
old_manifest = None
|
old_manifest = None
|
||||||
|
@ -700,7 +701,7 @@ class LegendaryCore:
|
||||||
self.lgd.save_manifest(game.app_name, new_manifest_data,
|
self.lgd.save_manifest(game.app_name, new_manifest_data,
|
||||||
version=new_manifest.meta.build_version)
|
version=new_manifest.meta.build_version)
|
||||||
# also fetch optimized delta manifest (may not exist)
|
# also fetch optimized delta manifest (may not exist)
|
||||||
if old_manifest and new_manifest and not (override_old_manifest or override_manifest):
|
if old_manifest and new_manifest and not (override_old_manifest or override_manifest or disable_delta):
|
||||||
delta_manifest_data = self.get_delta_manifest(randchoice(base_urls),
|
delta_manifest_data = self.get_delta_manifest(randchoice(base_urls),
|
||||||
old_manifest.meta.build_id,
|
old_manifest.meta.build_id,
|
||||||
new_manifest.meta.build_id)
|
new_manifest.meta.build_id)
|
||||||
|
@ -739,9 +740,11 @@ class LegendaryCore:
|
||||||
self.log.info(f'Install path: {install_path}')
|
self.log.info(f'Install path: {install_path}')
|
||||||
|
|
||||||
if repair:
|
if repair:
|
||||||
# use installed manifest for repairs, do not update to latest version (for now)
|
if not repair_use_latest:
|
||||||
new_manifest = old_manifest
|
# use installed manifest for repairs instead of updating
|
||||||
old_manifest = None
|
new_manifest = old_manifest
|
||||||
|
old_manifest = None
|
||||||
|
|
||||||
filename = clean_filename(f'{game.app_name}.repair')
|
filename = clean_filename(f'{game.app_name}.repair')
|
||||||
resume_file = os.path.join(self.lgd.get_tmp_path(), filename)
|
resume_file = os.path.join(self.lgd.get_tmp_path(), filename)
|
||||||
force = False
|
force = False
|
||||||
|
|
Loading…
Reference in a new issue