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

Commit bf60463

Browse files
committed
Playlist.extras now sets track.extras
1 parent af792e2 commit bf60463

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

wavelink/tracks.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ def extras(self) -> ExtrasNamespace:
592592
or a :class:`~wavelink.ExtrasNamespace`.
593593
594594
If a dict is passed, it will be converted into an :class:`~wavelink.ExtrasNamespace`,
595-
which can be converted back to a dict with dict(...). Additionally, you can also use list or tuple on
595+
which can be converted back to a dict with ``dict(...)``. Additionally, you can also use list or tuple on
596596
:class:`~wavelink.ExtrasNamespace`.
597597
598598
The extras dict will be sent to Lavalink as the ``userData`` field for each track in the playlist.
@@ -612,9 +612,9 @@ def extras(self) -> ExtrasNamespace:
612612
playlist.extras = {"requester_id": 1234567890}
613613
614614
# later...
615-
print(playlist.extras.requester_id)
615+
print(track.extras.requester_id)
616616
# or
617-
print(dict(playlist.extras)["requester_id"])
617+
print(dict(track.extras)["requester_id"])
618618
619619
620620
.. versionadded:: 3.2.0
@@ -629,8 +629,7 @@ def extras(self, __value: ExtrasNamespace | dict[str, Any]) -> None:
629629
self._extras = ExtrasNamespace(__value)
630630

631631
for track in self.tracks:
632-
for name, value in dict(self._extras).items():
633-
setattr(track, name, value)
632+
track.extras = __value
634633

635634

636635
class PlaylistInfo:

0 commit comments

Comments
 (0)