Skip to content

Commit

Permalink
Add SpotifyTrack hash
Browse files Browse the repository at this point in the history
Add SpotifyTrack hash and change EQ for Playable to raise instead of return
  • Loading branch information
chillymosh committed Jul 26, 2023
1 parent d5ea77b commit 2963857
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion wavelink/ext/spotify/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,10 @@ def __repr__(self) -> str:
def __eq__(self, other) -> bool:
if isinstance(other, SpotifyTrack):
return self.id == other.id
raise NotImplemented
raise NotImplementedError

def __hash__(self) -> int:
return hash(self.id)

@classmethod
async def search(
Expand Down
2 changes: 1 addition & 1 deletion wavelink/tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def __repr__(self) -> str:
def __eq__(self, other: object) -> bool:
if isinstance(other, Playable):
return self.encoded == other.encoded
return NotImplemented
raise NotImplementedError

@overload
@classmethod
Expand Down

0 comments on commit 2963857

Please sign in to comment.