From 92a0003e6fbecb6b2537287545c923ff9b33ef00 Mon Sep 17 00:00:00 2001 From: derrod Date: Sat, 18 Apr 2020 05:05:19 +0200 Subject: [PATCH] [core/lfs] Fix old manifest saving and install version saving --- legendary/core.py | 7 ++++--- legendary/lfs/lgndry.py | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/legendary/core.py b/legendary/core.py index 2435ee4..a89d728 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -341,7 +341,7 @@ class LegendaryCore: self.lgd.save_manifest(game.app_name, new_manifest_data) # save manifest with version name in "old" folder as well for testing/downgrading/etc. self.lgd.save_manifest(game.app_name, new_manifest_data, - filename=f'old/{game.app_name}_{new_manifest.meta.build_version}') + filename=f'{game.app_name}_{new_manifest.meta.build_version}', old=True) if not base_path: base_path = self.get_default_install_dir() @@ -388,8 +388,9 @@ class LegendaryCore: offline = game.metadata.get('customAttributes', {}).get('CanRunOffline', {}).get('value', 'true') ot = game.metadata.get('customAttributes', {}).get('OwnershipToken', {}).get('value', 'false') - igame = InstalledGame(app_name=game.app_name, title=game.app_title, version=game.app_version, - prereq_info=prereq, manifest_path=override_manifest, base_urls=base_urls, + igame = InstalledGame(app_name=game.app_name, title=game.app_title, + version=new_manifest.meta.build_version, prereq_info=prereq, + manifest_path=override_manifest, base_urls=base_urls, install_path=install_path, executable=new_manifest.meta.launch_exe, launch_parameters=new_manifest.meta.launch_command, can_run_offline=offline == 'true', requires_ot=ot == 'true', diff --git a/legendary/lfs/lgndry.py b/legendary/lfs/lgndry.py index 3c58fc0..8a3a8f3 100644 --- a/legendary/lfs/lgndry.py +++ b/legendary/lfs/lgndry.py @@ -123,9 +123,11 @@ class LGDLFS: else: return None - def save_manifest(self, app_name, manifest_data, filename=None): + def save_manifest(self, app_name, manifest_data, filename=None, old=False): if not filename: manifest_file = os.path.join(self.path, 'manifests', f'{app_name}.manifest') + elif filename and old: + manifest_file = os.path.join(self.path, 'manifests', f'old/{clean_filename(filename)}.manifest') else: manifest_file = os.path.join(self.path, 'manifests', f'{clean_filename(filename)}.manifest')