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:
CorpNewt 2023-09-15 18:28:50 -05:00 committed by GitHub
parent d7a7efb051
commit 3401b669e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -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"],