Skip to content

Commit

Permalink
[Hockey] Add The Stanley Cap and Capwages urls to player lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
TrustyJAID committed Nov 28, 2024
1 parent a528871 commit e588f1a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions hockey/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,14 @@ def cap_friendly_url(self) -> str:
def puckpedia_url(self) -> str:
return f"https://puckpedia.com/player/{self.full_name_url.lower()}"

@property
def the_stanley_cap_url(self) -> str:
return f"https://thestanleycap.com/players/{self.full_name_url.lower()}-{self.id}"

@property
def capwages_url(self) -> str:
return f"https://capwages.com/players/{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 @@ -576,6 +584,8 @@ def description(self) -> str:
_("[NHL]({ep_url})").format(ep_url=self.url),
# _("[Cap Friendly]({cf_url})").format(cf_url=self.cap_friendly_url),
_("[Puckpedia]({cf_url})").format(cf_url=self.puckpedia_url),
_("[The Stanley Cap]({cf_url})").format(cf_url=self.the_stanley_cap_url),
_("[Capwages]({cf_url})").format(cf_url=self.capwages_url),
]
if getattr(self, "dda_id", None):
links.append(
Expand Down Expand Up @@ -743,6 +753,8 @@ def description(self) -> str:
links = [
_("[Elite Prospects]({ep_url})").format(ep_url=self.ep_url()),
_("[Puckpedia]({cf_url})").format(cf_url=self.puckpedia_url()),
_("[The Stanley Cap]({cf_url})").format(cf_url=self.the_stanley_cap_url()),
_("[Capwages]({cf_url})").format(cf_url=self.capwages_url()),
# _("[Cap Friendly]({cf_url})").format(cf_url=self.cap_friendly_url()),
]
if getattr(self, "dda_id"):
Expand Down Expand Up @@ -827,6 +839,12 @@ def cap_friendly_url(self) -> str:
def puckpedia_url(self) -> str:
return f"https://puckpedia.com/player/{self.full_name_url()}"

def the_stanley_cap_url(self) -> str:
return f"https://thestanleycap.com/players/{self.full_name_url.lower()}-{self.id}"

def capwages_url(self) -> str:
return f"https://capwages.com/players/{self.full_name_url.lower()}"

@classmethod
async def from_id(
cls, player_id: int, session: Optional[aiohttp.ClientSession] = None
Expand Down

0 comments on commit e588f1a

Please sign in to comment.