mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 01:45:28 +00:00
[cli/lfs] Fix cleanup deleting in-use manifests using new naming convention
This commit is contained in:
parent
823d672c2c
commit
2b71b50d5c
|
@ -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')
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue