[core/models] Add uninstaller to game model

This commit is contained in:
derrod 2023-06-18 00:39:11 +02:00
parent 0e35b70941
commit 6d7909c311
2 changed files with 8 additions and 1 deletions

View file

@ -1472,6 +1472,11 @@ class LegendaryCore:
prereq = dict(ids=new_manifest.meta.prereq_ids, name=new_manifest.meta.prereq_name, prereq = dict(ids=new_manifest.meta.prereq_ids, name=new_manifest.meta.prereq_name,
path=new_manifest.meta.prereq_path, args=new_manifest.meta.prereq_args) path=new_manifest.meta.prereq_path, args=new_manifest.meta.prereq_args)
uninstaller = None
if new_manifest.meta.uninstall_action_path:
uninstaller = dict(path=new_manifest.meta.uninstall_action_path,
args=new_manifest.meta.uninstall_action_args)
offline = game.metadata.get('customAttributes', {}).get('CanRunOffline', {}).get('value', 'true') offline = game.metadata.get('customAttributes', {}).get('CanRunOffline', {}).get('value', 'true')
ot = game.metadata.get('customAttributes', {}).get('OwnershipToken', {}).get('value', 'false') ot = game.metadata.get('customAttributes', {}).get('OwnershipToken', {}).get('value', 'false')
@ -1495,7 +1500,7 @@ class LegendaryCore:
can_run_offline=offline == 'true', requires_ot=ot == 'true', can_run_offline=offline == 'true', requires_ot=ot == 'true',
is_dlc=base_game is not None, install_size=anlres.install_size, is_dlc=base_game is not None, install_size=anlres.install_size,
egl_guid=egl_guid, install_tags=file_install_tag, egl_guid=egl_guid, install_tags=file_install_tag,
platform=platform) platform=platform, uninstaller=uninstaller)
return dlm, anlres, igame return dlm, anlres, igame

View file

@ -149,6 +149,7 @@ class InstalledGame:
needs_verification: bool = False needs_verification: bool = False
platform: str = 'Windows' platform: str = 'Windows'
prereq_info: Optional[Dict] = None prereq_info: Optional[Dict] = None
uninstaller: Optional[Dict] = None
requires_ot: bool = False requires_ot: bool = False
save_path: Optional[str] = None save_path: Optional[str] = None
@ -165,6 +166,7 @@ class InstalledGame:
tmp.executable = json.get('executable', '') tmp.executable = json.get('executable', '')
tmp.launch_parameters = json.get('launch_parameters', '') tmp.launch_parameters = json.get('launch_parameters', '')
tmp.prereq_info = json.get('prereq_info', None) tmp.prereq_info = json.get('prereq_info', None)
tmp.uninstaller = json.get('uninstaller', None)
tmp.can_run_offline = json.get('can_run_offline', False) tmp.can_run_offline = json.get('can_run_offline', False)
tmp.requires_ot = json.get('requires_ot', False) tmp.requires_ot = json.get('requires_ot', False)