Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Spotify objects with different songs are equal in on_member_update #2113
When a song progresses to a different one on Spotify,
Seems to be caused by hashing the session id, which doesn't change between songs.
Doing a quick check reveals that comparing
A simple way to represent this is:
class MyClass: def __init__(self): self.id = 5 self.something_else = 2 def __eq__(self, other): return self.id == other.id my_list = [MyClass()] m = MyClass() m.something_else = 6 my_other_list = [m] print(my_list == my_other_list) # True because both instances of MyClass have the same ID
A way to work around this would be to compare the track_id of the Spotify instances instead.