From 691048d4813954b7acbd9ae0b61266d1380007be Mon Sep 17 00:00:00 2001 From: derrod Date: Thu, 14 Dec 2023 14:54:25 +0100 Subject: [PATCH] [models] Add is_launchable_addon property to Game objects --- legendary/models/game.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/legendary/models/game.py b/legendary/models/game.py index e1f5e30..3dfe043 100644 --- a/legendary/models/game.py +++ b/legendary/models/game.py @@ -97,6 +97,12 @@ class Game: return None return self.metadata.get('customAttributes', {}).get('AdditionalCommandLine', {}).get('value', None) + @property + def is_launchable_addon(self): + if not self.metadata: + return False + return any(m['path'] == 'addons/launchable' for m in self.metadata.get('categories', [])) + @property def catalog_item_id(self): if not self.metadata: