Fix build_track failure with Lavalink v4 decodetrack format.
This commit is contained in:
parent
179472bd6e
commit
6817cd8e07
|
|
@ -10,6 +10,7 @@ build/
|
|||
Pipfile.lock
|
||||
.mypy_cache/
|
||||
.vscode/
|
||||
.idea/
|
||||
.venv/
|
||||
*.code-workspace
|
||||
*.ini
|
||||
|
|
|
|||
|
|
@ -545,11 +545,19 @@ class Node:
|
|||
path="decodetrack",
|
||||
query=f"encodedTrack={quote(identifier)}",
|
||||
)
|
||||
|
||||
if self._version.major >= 4:
|
||||
track_info = data["info"]
|
||||
track_type = data["info"]["sourceName"]
|
||||
else:
|
||||
track_info = data
|
||||
track_type = data["sourceName"]
|
||||
|
||||
return Track(
|
||||
track_id=identifier,
|
||||
ctx=ctx,
|
||||
info=data,
|
||||
track_type=TrackType(data["sourceName"]),
|
||||
info=track_info,
|
||||
track_type=TrackType(track_type),
|
||||
)
|
||||
|
||||
async def get_tracks(
|
||||
|
|
|
|||
Loading…
Reference in New Issue