diff options
Diffstat (limited to 'code/utils/ai_recommendations.py')
-rw-r--r-- | code/utils/ai_recommendations.py | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/code/utils/ai_recommendations.py b/code/utils/ai_recommendations.py index 2fc71d3..1ff5415 100644 --- a/code/utils/ai_recommendations.py +++ b/code/utils/ai_recommendations.py @@ -62,16 +62,28 @@ async def add_song_recommendations( ytsearch = f"ytsearch:{song} by {artist} audio" results = await player.node.get_tracks(ytsearch) - if not (results and results.tracks) or results.load_type in ( - LoadType.EMPTY, - LoadType.ERROR, + if ( + not results + or not results.tracks + or not results.load_type + or results.load_type + in ( + LoadType.EMPTY, + LoadType.ERROR, + ) ): dzsearch = f"dzsearch:{song}" results = await player.node.get_tracks(dzsearch) - if not (results and results.tracks) or results.load_type in ( - LoadType.EMPTY, - LoadType.ERROR, + if ( + not results + or not results.tracks + or not results.load_type + or results.load_type + in ( + LoadType.EMPTY, + LoadType.ERROR, + ) ): continue |