From 2b71b50d5c2411afcb857354a3045d51da70025c Mon Sep 17 00:00:00 2001 From: derrod Date: Tue, 31 May 2022 13:25:56 +0200 Subject: [PATCH] [cli/lfs] Fix cleanup deleting in-use manifests using new naming convention --- legendary/cli.py | 4 ++-- legendary/lfs/lgndry.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/legendary/cli.py b/legendary/cli.py index f356064..3a96237 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -1893,8 +1893,8 @@ class LegendaryCLI: if not args.keep_manifests: logger.debug('Removing manifests...') - installed = [(ig.app_name, ig.version) for ig in self.core.get_installed_list()] - installed.extend((ig.app_name, ig.version) for ig in self.core.get_installed_dlc_list()) + installed = [(ig.app_name, ig.version, ig.platform) for ig in self.core.get_installed_list()] + installed.extend((ig.app_name, ig.version, ig.platform) for ig in self.core.get_installed_dlc_list()) self.core.lgd.clean_manifests(installed) logger.debug('Removing tmp data') diff --git a/legendary/lfs/lgndry.py b/legendary/lfs/lgndry.py index 07715f8..cee53f0 100644 --- a/legendary/lfs/lgndry.py +++ b/legendary/lfs/lgndry.py @@ -263,7 +263,9 @@ class LGDLFS: self.log.warning(f'Failed to delete file "{f}": {e!r}') def clean_manifests(self, in_use): - in_use_files = set(f'{clean_filename(f"{app_name}_{version}")}.manifest' for app_name, version in in_use) + in_use_files = set(f'{clean_filename(f"{app_name}_{version}")}.manifest' for app_name, version, _ in in_use) + in_use_files |= set(f'{clean_filename(f"{app_name}_{platform}_{version}")}.manifest' + for app_name, version, platform in in_use) for f in os.listdir(os.path.join(self.path, 'manifests')): if f not in in_use_files: try: