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:
@@ -226,7 +226,7 @@ class Basic(commands.Cog):
|
||||
if url(query):
|
||||
return await send_localized_message(ctx, "search.noLinkSupport", ephemeral=True)
|
||||
|
||||
search_type: voicelink.SearchType = voicelink.SearchType.match(platform) or Config().search_platform
|
||||
search_type: voicelink.SearchType = voicelink.SearchType.from_platform(platform) or Config().search_platform
|
||||
tracks = await player.get_tracks(query=query, requester=ctx.author, search_type=search_type)
|
||||
if not tracks:
|
||||
return await send_localized_message(ctx, "player.errors.noTrackFound")
|
||||
|
||||
Reference in New Issue
Block a user