Fix for YT URL searches on Lavalink v4
Since the prior code for v3 uses list comprehension to build the tracks returned, we can check if we're using v4 and if the data[data_type] is a dictionary, and wrap it in a list to ensure the same behavior.
This commit is contained in:
parent
d7a7efb051
commit
3401b669e8
|
|
@ -837,6 +837,8 @@ class Node:
|
||||||
)
|
)
|
||||||
|
|
||||||
elif load_type in ("SEARCH_RESULT", "TRACK_LOADED", "track", "search"):
|
elif load_type in ("SEARCH_RESULT", "TRACK_LOADED", "track", "search"):
|
||||||
|
if self._version.major >= 4 and isinstance(data[data_type],dict):
|
||||||
|
data[data_type] = [data[data_type]]
|
||||||
return [
|
return [
|
||||||
Track(
|
Track(
|
||||||
track_id=track["encoded"],
|
track_id=track["encoded"],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue