Skip to content

Commit

Permalink
[Hockey] Replace capfriendly urls with puckpedia
Browse files Browse the repository at this point in the history
  • Loading branch information
TrustyJAID committed Nov 28, 2024
1 parent 39ea234 commit a528871
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions hockey/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a528871

Please sign in to comment.