From 23c2f6dc0a7b46c3f781b88cca0371ad1e943b8c Mon Sep 17 00:00:00 2001 From: Stelios Tsampas Date: Thu, 4 May 2023 17:45:51 +0300 Subject: [PATCH] RareGame: Return `app_title` as folder name if `FolderName` is not in `customAttributes` Fortnite specifically doesn't provide `FolderName` in `customAttributes`, meaning we can't create the shortcut. If the attribute is not provided, assume that it is safe to use the application title. Fixes: #283 --- rare/models/game.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rare/models/game.py b/rare/models/game.py index 9e2addab..eeb3e876 100644 --- a/rare/models/game.py +++ b/rare/models/game.py @@ -438,7 +438,11 @@ class RareGame(RareGameSlim): @property def folder_name(self) -> str: - return self.game.metadata.get("customAttributes", {}).get("FolderName", {}).get("value") + return ( + folder_name + if (folder_name := self.game.metadata.get("customAttributes", {}).get("FolderName", {}).get("value")) + else self.app_title + ) @property def save_path(self) -> Optional[str]: