Skip to content

Commit

Permalink
AudioTrack.stream -> AudioTrack.is_stream
Browse files Browse the repository at this point in the history
  • Loading branch information
devoxin committed Mar 4, 2024
1 parent 9e5a024 commit 2bf388a
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions lavalink/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class AudioTrack:
The track's uploader.
duration: :class:`int`
The duration of the track, in milliseconds.
stream: :class:`bool`
is_stream: :class:`bool`
Whether the track is a live-stream.
title: :class:`str`
The title of the track.
Expand All @@ -110,7 +110,7 @@ class AudioTrack:
extra: Dict[str, Any]
Any extra properties given to this AudioTrack will be stored here.
"""
__slots__ = ('raw', 'track', 'identifier', 'is_seekable', 'author', 'duration', 'stream', 'title', 'uri',
__slots__ = ('raw', 'track', 'identifier', 'is_seekable', 'author', 'duration', 'is_stream', 'title', 'uri',
'artwork_url', 'isrc', 'position', 'source_name', 'plugin_info', 'user_data', 'extra')

def __init__(self, data: dict, requester: int = 0, **extra):
Expand All @@ -127,7 +127,7 @@ def __init__(self, data: dict, requester: int = 0, **extra):
self.is_seekable: bool = info['isSeekable']
self.author: str = info['author']
self.duration: int = info['length']
self.stream: bool = info['isStream']
self.is_stream: bool = info['isStream']
self.title: str = info['title']
self.uri: str = info['uri']
self.artwork_url: Optional[str] = info.get('artworkUrl')
Expand All @@ -150,6 +150,17 @@ def __getitem__(self, name):
def from_dict(cls, mapping: dict):
return cls(mapping)

@property
def stream(self) -> bool:
"""
Property indicating whether this track is a stream.
.. deprecated:: 5.3.0
To be consistent with attribute naming, this property has been deprecated
in favour of ``is_stream``.
"""
return self.is_stream

@property
def requester(self) -> int:
return self.extra['requester']
Expand Down

0 comments on commit 2bf388a

Please sign in to comment.