From 8e4bb8d3dd41108bdf65673bac3a53e9ef5decc7 Mon Sep 17 00:00:00 2001 From: derrod Date: Sun, 2 Jan 2022 13:08:14 +0100 Subject: [PATCH] [core] Fix required disk space calculation, once and for all --- legendary/core.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/legendary/core.py b/legendary/core.py index 45764ee..d3b7d8c 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -1372,15 +1372,8 @@ class LegendaryCore: base_path = os.path.split(install.install_path)[0] if os.path.exists(base_path): - # check if enough disk space is free (dl size is the approximate amount the installation will grow) - min_disk_space = analysis.install_size - if updating: - current_size = get_dir_size(install.install_path) - delta = max(0, analysis.install_size - current_size) - min_disk_space = delta + analysis.biggest_file_size - elif analysis.reuse_size: - min_disk_space -= analysis.reuse_size - + # Ensure that we have enough disk space for the installation process, as calculated by the analyser + min_disk_space = analysis.disk_space_delta _, _, free = shutil.disk_usage(base_path) if free < min_disk_space: free_mib = free / 1024 / 1024