Skip to content

Commit

Permalink
[models] Add is_launchable_addon property to Game objects
Browse files Browse the repository at this point in the history
  • Loading branch information
derrod committed Dec 14, 2023
1 parent 837c166 commit 691048d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions legendary/models/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ def additional_command_line(self):
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:
Expand Down

0 comments on commit 691048d

Please sign in to comment.