8000 `AudioTrack.stream` -> `AudioTrack.is_stream` · devoxin/Lavalink.py@2bf388a · GitHub
[go: up one dir, main page]

Skip to content

Commit 2bf388a

Browse files
committed
AudioTrack.stream -> AudioTrack.is_stream
1 parent 9e5a024 commit 2bf388a

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

lavalink/server.py

+14-3
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class AudioTrack:
8686
The track's uploader.
8787
duration: :class:`int`
8888
The duration of the track, in milliseconds.
89-
stream: :class:`bool`
89+
is_stream: :class:`bool`
9090
Whether the track is a live-stream.
9191
title: :class:`str`
9292
The title of the track.
@@ -110,7 +110,7 @@ class AudioTrack:
110110
extra: Dict[str, Any]
111111
Any extra properties given to this AudioTrack will be stored here.
112112
"""
113-
__slots__ = ('raw', 'track', 'identifier', 'is_seekable', 'author', 'duration', 'stream', 'title', 'uri',
113+
__slots__ = ('raw', 'track', 'identifier', 'is_seekable', 'author', 'duration', 'is_stream', 'title', 'uri',
114114
'artwork_url', 'isrc', 'position', 'source_name', 'plugin_info', 'user_data', 'extra')
115115

116116
def __init__(self, data: dict, requester: int = 0, **extra):
@@ -127,7 +127,7 @@ def __init__(self, data: dict, requester: int = 0, **extra):
127127
self.is_seekable: bool = info['isSeekable']
128128
self.author: str = info['author']
129129
self.duration: int = info['length']
130-
self.stream: bool = info['isStream']
130+
self.is_stream: bool = info['isStream']
131131
self.title: str = info['title']
132132
self.uri: str = info['uri']
133133
self.artwork_url: Optional[str] = info.get('artworkUrl')
@@ -150,6 +150,17 @@ def __getitem__(self, name):
150150
def from_dict(cls, mapping: dict):
151151
return cls(mapping)
152152

153+
@property
154+
def stream(self) -> bool:
155+
"""
156+
Property indicating whether this track is a stream.
157+
158+
.. deprecated:: 5.3.0
159+
To be consistent with attribute naming, this property has been deprecated
160+
in favour of ``is_stream``.
161+
"""
162+
return self.is_stream
163+
153164
@property
154165
def requester(self) -> int:
155166
return self.extra['requester']

0 commit comments

Comments
 (0)
0