From a5288710d795446cae5846971b3db67e5f55247e Mon Sep 17 00:00:00 2001 From: TrustyJAID Date: Wed, 27 Nov 2024 23:49:58 -0700 Subject: [PATCH] [Hockey] Replace capfriendly urls with puckpedia --- hockey/player.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hockey/player.py b/hockey/player.py index b70d3e29cb..e80d86d91c 100644 --- a/hockey/player.py +++ b/hockey/player.py @@ -498,6 +498,10 @@ def ep_url(self) -> str: def cap_friendly_url(self) -> str: return f"https://www.capfriendly.com/players/{self.full_name_url}" + @property + def puckpedia_url(self) -> str: + return f"https://puckpedia.com/player/{self.full_name_url.lower()}" + @property def url(self): return f"https://www.nhl.com/player/{self.first_name.lower()}-{self.last_name.lower()}-{self.id}" @@ -570,7 +574,8 @@ def description(self) -> str: msg += name + f"{getattr(self, attr, '')}\n" links = [ _("[NHL]({ep_url})").format(ep_url=self.url), - _("[Cap Friendly]({cf_url})").format(cf_url=self.cap_friendly_url), + # _("[Cap Friendly]({cf_url})").format(cf_url=self.cap_friendly_url), + _("[Puckpedia]({cf_url})").format(cf_url=self.puckpedia_url), ] if getattr(self, "dda_id", None): links.append( @@ -737,7 +742,8 @@ def description(self) -> str: msg += name + f"{getattr(self, attr)}\n" links = [ _("[Elite Prospects]({ep_url})").format(ep_url=self.ep_url()), - _("[Cap Friendly]({cf_url})").format(cf_url=self.cap_friendly_url()), + _("[Puckpedia]({cf_url})").format(cf_url=self.puckpedia_url()), + # _("[Cap Friendly]({cf_url})").format(cf_url=self.cap_friendly_url()), ] if getattr(self, "dda_id"): links.append( @@ -818,6 +824,9 @@ def ep_url(self) -> str: def cap_friendly_url(self) -> str: return f"https://www.capfriendly.com/players/{self.full_name_url()}" + def puckpedia_url(self) -> str: + return f"https://puckpedia.com/player/{self.full_name_url()}" + @classmethod async def from_id( cls, player_id: int, session: Optional[aiohttp.ClientSession] = None