From 3401b669e887489d3be5f669468d87111c6fba55 Mon Sep 17 00:00:00 2001 From: CorpNewt <12772521+corpnewt@users.noreply.github.com> Date: Fri, 15 Sep 2023 18:28:50 -0500 Subject: [PATCH] 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. --- pomice/pool.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pomice/pool.py b/pomice/pool.py index dd0aee5..5bf8c27 100644 --- a/pomice/pool.py +++ b/pomice/pool.py @@ -837,6 +837,8 @@ class Node: ) 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 [ Track( track_id=track["encoded"],