Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

Commit 2963857

Browse files
committed
Add SpotifyTrack hash
Add SpotifyTrack hash and change EQ for Playable to raise instead of return
1 parent d5ea77b commit 2963857

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

wavelink/ext/spotify/__init__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,10 @@ def __repr__(self) -> str:
211211
def __eq__(self, other) -> bool:
212212
if isinstance(other, SpotifyTrack):
213213
return self.id == other.id
214-
raise NotImplemented
214+
raise NotImplementedError
215+
216+
def __hash__(self) -> int:
217+
return hash(self.id)
215218

216219
@classmethod
217220
async def search(

wavelink/tracks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def __repr__(self) -> str:
150150
def __eq__(self, other: object) -> bool:
151151
if isinstance(other, Playable):
152152
return self.encoded == other.encoded
153-
return NotImplemented
153+
raise NotImplementedError
154154

155155
@overload
156156
@classmethod

0 commit comments

Comments
 (0)