diff --git a/aiosu/models/lazer.py b/aiosu/models/lazer.py index e5db569..847d2d0 100644 --- a/aiosu/models/lazer.py +++ b/aiosu/models/lazer.py @@ -175,13 +175,14 @@ def score_url(self) -> Optional[str]: :return: Link to the score on the osu! website :rtype: Optional[str] """ - if (not self.id and not self.best_id) or not self.passed: + if not self.id: return None - return ( - f"https://osu.ppy.sh/scores/{self.id}" - if self.type == "solo_score" - else f"https://osu.ppy.sh/scores/{self.mode.name_api}/{self.best_id}" - ) + if self.type == "solo_score": + return f"https://osu.ppy.sh/scores/{self.id}" + + if not self.best_id: # Legacy URL format + return None + return f"https://osu.ppy.sh/scores/{self.mode.name_api}/{self.best_id}" @property def replay_url(self) -> Optional[str]: diff --git a/aiosu/models/score.py b/aiosu/models/score.py index 2b1d2b5..4c92dcd 100644 --- a/aiosu/models/score.py +++ b/aiosu/models/score.py @@ -171,13 +171,14 @@ def score_url(self) -> Optional[str]: :return: Link to the score on the osu! website :rtype: Optional[str] """ - if (not self.id and not self.best_id) or not self.passed: + if not self.id: return None - return ( - f"https://osu.ppy.sh/scores/{self.id}" - if self.type == "solo_score" - else f"https://osu.ppy.sh/scores/{self.mode.name_api}/{self.best_id}" - ) + if self.type == "solo_score": + return f"https://osu.ppy.sh/scores/{self.id}" + + if not self.best_id or not self.passed: # Legacy URL format + return None + return f"https://osu.ppy.sh/scores/{self.mode.name_api}/{self.best_id}" @property def replay_url(self) -> Optional[str]: