diff --git a/legendary/core.py b/legendary/core.py index a75d3e0..3662dd5 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -662,6 +662,7 @@ class LegendaryCore: ) -> (DLManager, AnalysisResult, ManifestMeta): # load old manifest old_manifest = None + delta_manifest_used = False # load old manifest if we have one if override_old_manifest: @@ -711,6 +712,7 @@ class LegendaryCore: f'"{old_manifest.meta.build_id}" to' f'"{new_manifest.meta.build_id}"...') new_manifest = delta_manifest + delta_manifest_used = True else: self.log.debug(f'No Delta manifest received from CDN.') @@ -782,7 +784,8 @@ class LegendaryCore: file_prefix_filter=file_prefix_filter, file_exclude_filter=file_exclude_filter, file_install_tag=file_install_tag, - processing_optimization=process_opt) + processing_optimization=process_opt, + delta_manifest_used=delta_manifest_used) prereq = None if new_manifest.meta.prereq_ids: diff --git a/legendary/downloader/manager.py b/legendary/downloader/manager.py index 772aa02..60293a0 100644 --- a/legendary/downloader/manager.py +++ b/legendary/downloader/manager.py @@ -79,7 +79,7 @@ class DLManager(Process): def run_analysis(self, manifest: Manifest, old_manifest: Manifest = None, patch=True, resume=True, file_prefix_filter=None, file_exclude_filter=None, file_install_tag=None, - processing_optimization=False) -> AnalysisResult: + processing_optimization=False, delta_manifest_used=False) -> AnalysisResult: """ Run analysis on manifest and old manifest (if not None) and return a result with a summary resources required in order to install the provided manifest. @@ -92,6 +92,7 @@ class DLManager(Process): :param file_exclude_filter: Exclude files with this prefix from download :param file_install_tag: Only install files with the specified tag :param processing_optimization: Attempt to optimize processing order and RAM usage + :param delta_manifest_used: whether or not the manifest is a delta manifest :return: AnalysisResult """ @@ -181,6 +182,10 @@ class DLManager(Process): analysis_res.install_size = sum(fm.file_size for fm in manifest.file_manifest_list.elements if fm.filename in mc.added) + # todo properly handle delta manifests + if delta_manifest_used: + mc.removed = set() + if mc.removed: analysis_res.removed = len(mc.removed) self.log.debug(f'{analysis_res.removed} removed files')