From 30acc7d55ed99aba576d02a1551241b3f8ec1a27 Mon Sep 17 00:00:00 2001 From: derrod Date: Thu, 17 Dec 2020 14:49:56 +0100 Subject: [PATCH] [models] Add install tags to game models --- legendary/models/egl.py | 6 +++++- legendary/models/game.py | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/legendary/models/egl.py b/legendary/models/egl.py index 7b6a6f5..c125cc1 100644 --- a/legendary/models/egl.py +++ b/legendary/models/egl.py @@ -58,6 +58,7 @@ class EGLManifest: self.display_name = None self.install_location = None self.install_size = None + self.install_tags = None self.installation_guid = None self.launch_command = None self.executable = None @@ -85,6 +86,7 @@ class EGLManifest: tmp.display_name = json.pop('DisplayName', '') tmp.install_location = json.pop('InstallLocation', '') tmp.install_size = json.pop('InstallSize', 0) + tmp.install_tags = json.pop('InstallTags', []) tmp.installation_guid = json.pop('InstallationGuid', '') tmp.launch_command = json.pop('LaunchCommand', '') tmp.executable = json.pop('LaunchExecutable', '') @@ -111,6 +113,7 @@ class EGLManifest: out['DisplayName'] = self.display_name out['InstallLocation'] = self.install_location out['InstallSize'] = self.install_size + out['InstallTags'] = self.install_tags out['InstallationGuid'] = self.installation_guid out['LaunchCommand'] = self.launch_command out['LaunchExecutable'] = self.executable @@ -136,6 +139,7 @@ class EGLManifest: tmp.display_name = igame.title tmp.install_location = igame.install_path tmp.install_size = igame.install_size + tmp.install_tags = igame.install_tags tmp.installation_guid = igame.egl_guid tmp.launch_command = igame.launch_parameters tmp.executable = igame.executable @@ -155,4 +159,4 @@ class EGLManifest: launch_parameters=self.launch_command, can_run_offline=self.can_run_offline, requires_ot=self.ownership_token, is_dlc=False, 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) diff --git a/legendary/models/game.py b/legendary/models/game.py index 1e8c86c..16e2d79 100644 --- a/legendary/models/game.py +++ b/legendary/models/game.py @@ -79,7 +79,7 @@ class InstalledGame: def __init__(self, app_name='', title='', version='', manifest_path='', base_urls=None, install_path='', executable='', launch_parameters='', prereq_info=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.title = title self.version = version @@ -97,6 +97,7 @@ class InstalledGame: self.needs_verification = needs_verification self.install_size = install_size self.egl_guid = egl_guid + self.install_tags = install_tags if install_tags else [] @classmethod def from_json(cls, json): @@ -119,6 +120,7 @@ class InstalledGame: tmp.needs_verification = json.get('needs_verification', False) is True tmp.install_size = json.get('install_size', 0) tmp.egl_guid = json.get('egl_guid', '') + tmp.install_tags = json.get('install_tags', []) return tmp