mirror of
https://github.com/derrod/legendary.git
synced 2025-01-03 04:45:28 +00:00
[models] Add install tags to game models
This commit is contained in:
parent
df9380ab3d
commit
30acc7d55e
|
@ -58,6 +58,7 @@ class EGLManifest:
|
||||||
self.display_name = None
|
self.display_name = None
|
||||||
self.install_location = None
|
self.install_location = None
|
||||||
self.install_size = None
|
self.install_size = None
|
||||||
|
self.install_tags = None
|
||||||
self.installation_guid = None
|
self.installation_guid = None
|
||||||
self.launch_command = None
|
self.launch_command = None
|
||||||
self.executable = None
|
self.executable = None
|
||||||
|
@ -85,6 +86,7 @@ class EGLManifest:
|
||||||
tmp.display_name = json.pop('DisplayName', '')
|
tmp.display_name = json.pop('DisplayName', '')
|
||||||
tmp.install_location = json.pop('InstallLocation', '')
|
tmp.install_location = json.pop('InstallLocation', '')
|
||||||
tmp.install_size = json.pop('InstallSize', 0)
|
tmp.install_size = json.pop('InstallSize', 0)
|
||||||
|
tmp.install_tags = json.pop('InstallTags', [])
|
||||||
tmp.installation_guid = json.pop('InstallationGuid', '')
|
tmp.installation_guid = json.pop('InstallationGuid', '')
|
||||||
tmp.launch_command = json.pop('LaunchCommand', '')
|
tmp.launch_command = json.pop('LaunchCommand', '')
|
||||||
tmp.executable = json.pop('LaunchExecutable', '')
|
tmp.executable = json.pop('LaunchExecutable', '')
|
||||||
|
@ -111,6 +113,7 @@ class EGLManifest:
|
||||||
out['DisplayName'] = self.display_name
|
out['DisplayName'] = self.display_name
|
||||||
out['InstallLocation'] = self.install_location
|
out['InstallLocation'] = self.install_location
|
||||||
out['InstallSize'] = self.install_size
|
out['InstallSize'] = self.install_size
|
||||||
|
out['InstallTags'] = self.install_tags
|
||||||
out['InstallationGuid'] = self.installation_guid
|
out['InstallationGuid'] = self.installation_guid
|
||||||
out['LaunchCommand'] = self.launch_command
|
out['LaunchCommand'] = self.launch_command
|
||||||
out['LaunchExecutable'] = self.executable
|
out['LaunchExecutable'] = self.executable
|
||||||
|
@ -136,6 +139,7 @@ class EGLManifest:
|
||||||
tmp.display_name = igame.title
|
tmp.display_name = igame.title
|
||||||
tmp.install_location = igame.install_path
|
tmp.install_location = igame.install_path
|
||||||
tmp.install_size = igame.install_size
|
tmp.install_size = igame.install_size
|
||||||
|
tmp.install_tags = igame.install_tags
|
||||||
tmp.installation_guid = igame.egl_guid
|
tmp.installation_guid = igame.egl_guid
|
||||||
tmp.launch_command = igame.launch_parameters
|
tmp.launch_command = igame.launch_parameters
|
||||||
tmp.executable = igame.executable
|
tmp.executable = igame.executable
|
||||||
|
@ -155,4 +159,4 @@ class EGLManifest:
|
||||||
launch_parameters=self.launch_command, can_run_offline=self.can_run_offline,
|
launch_parameters=self.launch_command, can_run_offline=self.can_run_offline,
|
||||||
requires_ot=self.ownership_token, is_dlc=False,
|
requires_ot=self.ownership_token, is_dlc=False,
|
||||||
needs_verification=self.needs_validation, install_size=self.install_size,
|
needs_verification=self.needs_validation, install_size=self.install_size,
|
||||||
egl_guid=self.installation_guid)
|
egl_guid=self.installation_guid, install_tags=self.install_tags)
|
||||||
|
|
|
@ -79,7 +79,7 @@ class InstalledGame:
|
||||||
def __init__(self, app_name='', title='', version='', manifest_path='', base_urls=None,
|
def __init__(self, app_name='', title='', version='', manifest_path='', base_urls=None,
|
||||||
install_path='', executable='', launch_parameters='', prereq_info=None,
|
install_path='', executable='', launch_parameters='', prereq_info=None,
|
||||||
can_run_offline=False, requires_ot=False, is_dlc=False, save_path=None,
|
can_run_offline=False, requires_ot=False, is_dlc=False, save_path=None,
|
||||||
needs_verification=False, install_size=0, egl_guid=''):
|
needs_verification=False, install_size=0, egl_guid='', install_tags=None):
|
||||||
self.app_name = app_name
|
self.app_name = app_name
|
||||||
self.title = title
|
self.title = title
|
||||||
self.version = version
|
self.version = version
|
||||||
|
@ -97,6 +97,7 @@ class InstalledGame:
|
||||||
self.needs_verification = needs_verification
|
self.needs_verification = needs_verification
|
||||||
self.install_size = install_size
|
self.install_size = install_size
|
||||||
self.egl_guid = egl_guid
|
self.egl_guid = egl_guid
|
||||||
|
self.install_tags = install_tags if install_tags else []
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_json(cls, json):
|
def from_json(cls, json):
|
||||||
|
@ -119,6 +120,7 @@ class InstalledGame:
|
||||||
tmp.needs_verification = json.get('needs_verification', False) is True
|
tmp.needs_verification = json.get('needs_verification', False) is True
|
||||||
tmp.install_size = json.get('install_size', 0)
|
tmp.install_size = json.get('install_size', 0)
|
||||||
tmp.egl_guid = json.get('egl_guid', '')
|
tmp.egl_guid = json.get('egl_guid', '')
|
||||||
|
tmp.install_tags = json.get('install_tags', [])
|
||||||
return tmp
|
return tmp
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue