From 5ea27a924b7af1106a4fffe9798bc41fd70c1662 Mon Sep 17 00:00:00 2001 From: Oliver Wilkes Date: Sun, 21 May 2023 19:21:03 +0100 Subject: [PATCH] fix(node): fix decode_track parsing (#80) --- mafic/node.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mafic/node.py b/mafic/node.py index 6553e6a..82df6cc 100644 --- a/mafic/node.py +++ b/mafic/node.py @@ -58,7 +58,6 @@ Player as PlayerPayload, PluginData, RoutePlannerStatus as RoutePlannerStatusPayload, - TrackInfo, TrackLoadingResult, UpdatePlayerParams, UpdatePlayerPayload, @@ -94,9 +93,9 @@ def _wrap_regions( for item in regions: if isinstance(item, Group): for region in item.value: - actual_regions.append(region.value) + actual_regions.extend(region.value) elif isinstance(item, Region): - actual_regions.append(item.value) + actual_regions.extend(item.value) elif isinstance( item, VoiceRegion ): # pyright: ignore[reportUnnecessaryIsInstance] @@ -1124,11 +1123,11 @@ async def decode_track(self, track: str) -> Track: -------- :meth:`decode_tracks` """ - info: TrackInfo = await self.__request( + track_object: TrackWithInfo = await self.__request( "GET", "decodetrack", params={"encodedTrack": track} ) - return Track.from_data(track=track, info=info) + return Track.from_data_with_info(track_object) async def decode_tracks(self, tracks: list[str]) -> list[Track]: r"""Decode a list of tracks from the encoded base64 data.