From e6bb64f16fe1d27f464e0cb71255d0247100aaae Mon Sep 17 00:00:00 2001 From: derrod Date: Tue, 12 Oct 2021 15:24:49 +0200 Subject: [PATCH] [core] Only delete files that are actually installed (based on tags) --- legendary/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/legendary/core.py b/legendary/core.py index addc5e6..ec89067 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -1181,7 +1181,10 @@ class LegendaryCore: if delete_files: try: manifest = self.load_manifest(self.get_installed_manifest(installed_game.app_name)[0]) - filelist = [fm.filename for fm in manifest.file_manifest_list.elements] + filelist = [ + fm.filename for fm in manifest.file_manifest_list.elements if + not fm.install_tags or any(t in installed_game.install_tags for t in fm.install_tags) + ] if not delete_filelist(installed_game.install_path, filelist, delete_root_directory): self.log.error(f'Deleting "{installed_game.install_path}" failed, please remove manually.') except Exception as e: