Merge pull request #6 from vveeps/track-eq
This commit is contained in:
commit
fe1e49182b
|
|
@ -30,6 +30,15 @@ class Track:
|
||||||
self.is_seekable = info.get("isSeekable")
|
self.is_seekable = info.get("isSeekable")
|
||||||
self.position = info.get("position")
|
self.position = info.get("position")
|
||||||
|
|
||||||
|
def __eq__(self, other):
|
||||||
|
if not isinstance(other, Track):
|
||||||
|
return False
|
||||||
|
|
||||||
|
if self.ctx and other.ctx:
|
||||||
|
return other.track_id == self.track_id and other.ctx.message.id == self.ctx.message.id
|
||||||
|
|
||||||
|
return other.track_id == self.track_id
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.title
|
return self.title
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue