Refactor track recommendation logic and add TrackRecType enum
Moved recommendation query generation from Node to Track using the new TrackRecType enum, simplifying and centralizing platform-specific recommendation formatting. Updated related methods to use Track.get_recommendations, removed Node.get_recommendations, and improved enum handling for search platform matching. Also exposed TrackRecType in voicelink.__init__.
This commit is contained in:
@@ -152,7 +152,7 @@ async def getRecommendation(bot: commands.Bot, data: Dict) -> None:
|
||||
|
||||
track_data = Track.decode(track_id := data.get("trackId"))
|
||||
track = Track(track_id=track_id, info=track_data, requester=bot.user)
|
||||
tracks: List[Track] = await node.get_recommendations(track, limit=60)
|
||||
tracks: List[Track] = await track.get_recommendations(node)
|
||||
|
||||
return {
|
||||
"op": "getRecommendation",
|
||||
|
||||
Reference in New Issue
Block a user